# HG changeset patch # User Martin Geisler # Date 1287562384 -7200 # Node ID 614f0d8724ab9cc49fba959a9f23845827f5c02b # Parent daa8dc6e1f66957bbabdcc21f870d12bc1efe60f check-code: find trailing whitespace diff -r daa8dc6e1f66 -r 614f0d8724ab contrib/check-code.py --- a/contrib/check-code.py Wed Oct 20 10:07:38 2010 +0200 +++ b/contrib/check-code.py Wed Oct 20 10:13:04 2010 +0200 @@ -110,6 +110,7 @@ (r'.{85}', "line too long"), (r'.{81}', "warning: line over 80 characters"), (r'[^\n]\Z', "no trailing newline"), + (r'(\S\s+|^\s+)\n', "trailing whitespace"), # (r'^\s+[^_ ][^_. ]+_[^_]+\s*=', "don't use underbars in identifiers"), # (r'\w*[a-z][A-Z]\w*\s*=', "don't use camelcase in identifiers"), (r'^\s*(if|while|def|class|except|try)\s[^[]*:\s*[^\]#\s]+', diff -r daa8dc6e1f66 -r 614f0d8724ab hgext/convert/subversion.py --- a/hgext/convert/subversion.py Wed Oct 20 10:07:38 2010 +0200 +++ b/hgext/convert/subversion.py Wed Oct 20 10:13:04 2010 +0200 @@ -651,7 +651,7 @@ else: self.ui.debug('unknown path in revision %d: %s\n' % \ (revnum, path)) - elif kind == svn.core.svn_node_dir: + elif kind == svn.core.svn_node_dir: if ent.action == 'M': # If the directory just had a prop change, # then we shouldn't need to look for its children. @@ -823,7 +823,7 @@ def getfile(self, file, rev): # TODO: ra.get_file transmits the whole file instead of diffs. if file in self.removed: - raise IOError() + raise IOError() mode = '' try: new_module, revnum = self.revsplit(rev)[1:] @@ -892,7 +892,7 @@ finally: if module is not None: self.reparent(prevmodule) - + def _getlog(self, paths, start, end, limit=0, discover_changed_paths=True, strict_node_history=False): # Normalize path names, svn >= 1.5 only wants paths relative to diff -r daa8dc6e1f66 -r 614f0d8724ab mercurial/dispatch.py --- a/mercurial/dispatch.py Wed Oct 20 10:07:38 2010 +0200 +++ b/mercurial/dispatch.py Wed Oct 20 10:13:04 2010 +0200 @@ -407,7 +407,7 @@ def _getlocal(ui, rpath): """Return (path, local ui object) for the given target path. - + Takes paths in [cwd]/.hg/hgrc into account." """ try: diff -r daa8dc6e1f66 -r 614f0d8724ab mercurial/encoding.py --- a/mercurial/encoding.py Wed Oct 20 10:07:38 2010 +0200 +++ b/mercurial/encoding.py Wed Oct 20 10:13:04 2010 +0200 @@ -15,7 +15,7 @@ for Python 2.7 and up. This is the same corrected code for earlier Python versions. - However, we can't use a version check for this method, as some distributions + However, we can't use a version check for this method, as some distributions patch Python to fix this. Instead, we use it as a 'fixer' for the mac-roman encoding, as it is unlikely that this encoding is the actually expected. ''' diff -r daa8dc6e1f66 -r 614f0d8724ab mercurial/subrepo.py --- a/mercurial/subrepo.py Wed Oct 20 10:07:38 2010 +0200 +++ b/mercurial/subrepo.py Wed Oct 20 10:13:04 2010 +0200 @@ -192,7 +192,7 @@ if repo.ui.config('paths', 'default'): return repo.ui.config('paths', 'default') if abort: - raise util.Abort(_("default path for subrepository %s not found") % + raise util.Abort(_("default path for subrepository %s not found") % reporelpath(repo)) def itersubrepos(ctx1, ctx2): diff -r daa8dc6e1f66 -r 614f0d8724ab mercurial/url.py --- a/mercurial/url.py Wed Oct 20 10:07:38 2010 +0200 +++ b/mercurial/url.py Wed Oct 20 10:13:04 2010 +0200 @@ -489,7 +489,7 @@ def _verifycert(cert, hostname): '''Verify that cert (in socket.getpeercert() format) matches hostname. CRLs and subjectAltName are not handled. - + Returns error message if any problems are found and None on success. ''' if not cert: