convert/svn: clarify svn_source.latest() stop arg default value stable
authorPatrick Mezard <patrick@mezard.eu>
Wed, 18 Apr 2012 14:04:57 +0200
branchstable
changeset 16464 0e1329d905df
parent 16463 cef755f86d5c
child 16465 ad38b96c88f9
convert/svn: clarify svn_source.latest() stop arg default value stop=0 could pass for a valid default value at first sight.
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Tue Apr 17 21:12:37 2012 -0700
+++ b/hgext/convert/subversion.py	Wed Apr 18 14:04:57 2012 +0200
@@ -555,18 +555,20 @@
     def revnum(self, rev):
         return int(rev.split('@')[-1])
 
-    def latest(self, path, stop=0):
-        """Find the latest revid affecting path, up to stop. It may return
-        a revision in a different module, since a branch may be moved without
-        a change being reported. Return None if computed module does not
-        belong to rootmodule subtree.
+    def latest(self, path, stop=None):
+        """Find the latest revid affecting path, up to stop revision
+        number. If stop is None, default to repository latest
+        revision. It may return a revision in a different module,
+        since a branch may be moved without a change being
+        reported. Return None if computed module does not belong to
+        rootmodule subtree.
         """
         if not path.startswith(self.rootmodule):
             # Requests on foreign branches may be forbidden at server level
             self.ui.debug('ignoring foreign branch %r\n' % path)
             return None
 
-        if not stop:
+        if stop is None:
             stop = svn.ra.get_latest_revnum(self.ra)
         try:
             prevmodule = self.reparent('')