diff hgext/graphlog.py @ 10365:d757bc0c7865

interpret repo#name url syntax as branch instead of revision Previously, the name part of an repo#name url was interpreted as a revision, similar to using the --rev option. Now it is instead looked up as a branch first, and if that succeeds all the heads of the branch will be processed instead of just its tip-most head. If the branch lookup fails, it will be assumed to be an revision as before (e.g. for tags).
author Sune Foldager <cryo@cyanite.org>
date Sun, 07 Feb 2010 14:29:07 +0100
parents b9e44cc97355
children a78bfaf988e1
line wrap: on
line diff
--- a/hgext/graphlog.py	Sun Feb 07 14:01:43 2010 +0100
+++ b/hgext/graphlog.py	Sun Feb 07 14:29:07 2010 +0100
@@ -276,12 +276,12 @@
     """
 
     check_unsupported_flags(opts)
-    dest, revs, checkout = hg.parseurl(
-        ui.expandpath(dest or 'default-push', dest or 'default'),
-        opts.get('rev'))
+    dest = ui.expandpath(dest or 'default-push', dest or 'default')
+    dest, branches = hg.parseurl(dest)
+    revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
+    other = hg.repository(cmdutil.remoteui(ui, opts), dest)
     if revs:
         revs = [repo.lookup(rev) for rev in revs]
-    other = hg.repository(cmdutil.remoteui(ui, opts), dest)
     ui.status(_('comparing with %s\n') % url.hidepassword(dest))
     o = repo.findoutgoing(other, force=opts.get('force'))
     if not o:
@@ -305,8 +305,9 @@
     """
 
     check_unsupported_flags(opts)
-    source, revs, checkout = hg.parseurl(ui.expandpath(source), opts.get('rev'))
+    source, branches = hg.parseurl(ui.expandpath(source))
     other = hg.repository(cmdutil.remoteui(repo, opts), source)
+    revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
     ui.status(_('comparing with %s\n') % url.hidepassword(source))
     if revs:
         revs = [other.lookup(rev) for rev in revs]