addbranchrevs: fallback for older servers
authorSune Foldager <cryo@cyanite.org>
Sun, 07 Feb 2010 15:57:16 +0100
changeset 10380 ee72d89c0d9f
parent 10379 a78bfaf988e1
child 10381 a7df048b6a0d
addbranchrevs: fallback for older servers
mercurial/hg.py
--- a/mercurial/hg.py	Sun Feb 07 15:23:46 2010 +0100
+++ b/mercurial/hg.py	Sun Feb 07 15:57:16 2010 +0100
@@ -21,8 +21,11 @@
 def addbranchrevs(lrepo, repo, branches, revs):
     if not branches:
         return revs or None, revs and revs[0] or None
+    revs = revs and list(revs) or []
+    if not repo.capable('branchmap'):
+        revs.extend(branches)
+        return revs, revs[0]
     branchmap = repo.branchmap()
-    revs = revs and list(revs) or []
     for branch in branches:
         if branch == '.':
             if not lrepo or not lrepo.local():