diff hgext/graphlog.py @ 14086:2d7cb340a53f

graphlog: log -G --follow file does not work, forbid it We do not have revsets to follow file history.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 30 Apr 2011 19:42:00 +0200
parents 4852753dae36
children 5e4ec4119485
line wrap: on
line diff
--- a/hgext/graphlog.py	Sat Apr 30 19:42:00 2011 +0200
+++ b/hgext/graphlog.py	Sat Apr 30 19:42:00 2011 +0200
@@ -214,11 +214,14 @@
     else:
         return (len(repo) - 1, 0)
 
-def check_unsupported_flags(opts):
+def check_unsupported_flags(pats, opts):
     for op in ["follow_first", "copies", "newest_first"]:
         if op in opts and opts[op]:
             raise util.Abort(_("-G/--graph option is incompatible with --%s")
                              % op.replace("_", "-"))
+    if pats and opts.get('follow'):
+        raise util.Abort(_("-G/--graph option is incompatible with --follow "
+                           "with file argument"))
 
 def revset(pats, opts):
     """Return revset str built of revisions, log options and file patterns.
@@ -286,7 +289,7 @@
     directory.
     """
 
-    check_unsupported_flags(opts)
+    check_unsupported_flags(pats, opts)
 
     revs = revrange(repo, [revset(pats, opts)])
     revdag = graphmod.dagwalker(repo, revs)
@@ -312,7 +315,7 @@
     directory.
     """
 
-    check_unsupported_flags(opts)
+    check_unsupported_flags([], opts)
     o = hg._outgoing(ui, repo, dest, opts)
     if o is None:
         return
@@ -334,7 +337,7 @@
     def subreporecurse():
         return 1
 
-    check_unsupported_flags(opts)
+    check_unsupported_flags([], opts)
     def display(other, chlist, displayer):
         revdag = graphrevs(other, chlist, opts)
         showparents = [ctx.node() for ctx in repo[None].parents()]