Commits

Michael Tharp  committed 1889731 Merge
  • Participants
  • Parent commits 765bee0, 3647b4b

Comments (0)

Files changed (2)

     parseurl = cmdutil.parseurl
 except:
     try:
-        parseurl = hg.parseurl
+        _parseurl = hg.parseurl
+        def parseurl(url, branches=None):
+            url, revs = _parseurl(url, branches)
+            if isinstance(revs, tuple):
+                # hg >= 1.6
+                return url, revs[1]
+            return url, revs
     except:
         def parseurl(url, revs):
             """Mercurial <= 0.9.3 doesn't have this feature."""
 
 localrepo.localrepository.forests = _localrepo_forests
 
+def repocall(repo, *args, **kwargs):
+    if hasattr(repo, '_call'):
+        # hg >= 1.7
+        callfn = repo._call
+    else:
+        callfn = repo.do_read
+    return callfn(*args, **kwargs)
 
 def _sshrepo_forests(self, walkhg):
     """Shim this function into mercurial.sshrepo.sshrepository so
         raise util.Abort(_("Remote forests cannot be cloned because the "
                            "other repository doesn't support the forest "
                            "extension."))
-    if hasattr(self, 'call'):
-        # hg < 1.7
-        func = self.call
-    else:
-        # hg >= 1.7
-        func = self._call
-    data = func("forests", walkhg=("", "True")[walkhg])
+    data = repocall(self, "forests", walkhg=("", "True")[walkhg])
     return data.splitlines()
 
 sshrepo.sshrepository.forests = _sshrepo_forests
         raise util.Abort(_("Remote forests cannot be cloned because the "
                            "other repository doesn't support the forest "
                            "extension."))
-    if hasattr(self, 'do_read'):
-        # < 1.7
-        func = self.do_read
-    else:
-        # >= 1.7
-        func = self._call
-    data = func("forests", walkhg=("", "True")[walkhg])
+    data = repocall(self, "forests", walkhg=("", "True")[walkhg])
     return data.splitlines()
 
 httprepo.httprepository.forests = _httprepo_forests
         if paths:
             # Extract revisions from # syntax in path.
             paths[0], revs = parseurl(paths[0], opts['rev'])[0:2]
-            if isinstance(revs, tuple):
-                # hg >= 1.6
-                revs = revs[1]
         elif 'rev' in opts:
             revs = opts['rev']
         else:
-            revs = None
+            revs = []
         die_on_numeric_revs(revs)
         for tree in self.trees:
             rpath = relpath(self.top().root, tree.root)
         def __init__(self, transform, ui):
             self._transform = transform
             self._ui = ui
-        def write(self, output, **kwargs):
-            self._ui.write(self._transform(output), **kwargs)
+        def write(self, *args, **opts):
+            args = [self._transform(a) for a in args]
+            self._ui.write(*args, **opts)
         def __getattr__(self, attrname):
             return getattr(self._ui, attrname)
 

File test-forest.out

 
 # fclone
 [.]
-updating working directory
+updating to branch default
 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [d/d/t]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [e/d]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t/t]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 # fsnap
 summary:     new line
 
 # fseed
-updating working directory
+updating to branch default
 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
 [d/d/t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [e/d]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t/t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [tree1]
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t/t]
 adding manifests
 adding file changes
 added 2 changesets with 2 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 # foutgoing
 
 # fseed and fpull, missing section
 [.]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 3 changes to 3 files
-updating working directory
+updating to branch default
 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [e/d]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t/t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 .
 t
 t/t
 [e/d]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t/t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 .
 t/t
 [.]
 pulling from HGTMP/test-forest/toplevel
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 
 # fseed and fpull, named section
 [.]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 3 changes to 3 files
-updating working directory
+updating to branch default
 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [d/d/t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [e/d]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t/t]
-requesting all changes
 adding changesets
 adding manifests
 adding file changes
 added 1 changesets with 1 changes to 1 files
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 .
 
 # fclone + mq
 [.]
-updating working directory
+updating to branch default
 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [d/d/t]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [e/d]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [t]
 skipped: 't/t' has mq patches applied
 
 [t/t/.hg/patches]
-updating working directory
+updating to branch default
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 # fsnap + mq
 adding f
 adding f
 [.]
-updating working directory
+updating to branch default
 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [a]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [b]
-updating working directory
+updating to branch default
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 [.]