diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -110,6 +110,7 @@ pypats = [ (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 --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -651,7 +651,7 @@ class svn_source(converter_source): 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 @@ class svn_source(converter_source): 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 @@ class svn_source(converter_source): 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 --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -407,7 +407,7 @@ def runcommand(lui, repo, cmd, fullargs, def _getlocal(ui, rpath): """Return (path, local ui object) for the given target path. - + Takes paths in [cwd]/.hg/hgrc into account." """ try: diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -15,7 +15,7 @@ def _getpreferredencoding(): 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 --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -192,7 +192,7 @@ def _abssource(repo, push=False, abort=T 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 --git a/mercurial/url.py b/mercurial/url.py --- a/mercurial/url.py +++ b/mercurial/url.py @@ -489,7 +489,7 @@ class httphandler(keepalive.HTTPHandler) 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: