changeset 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 f3d585c9b042
files hgext/graphlog.py tests/test-glog.t
diffstat 2 files changed, 10 insertions(+), 4 deletions(-) [+]
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()]
--- a/tests/test-glog.t	Sat Apr 30 19:42:00 2011 +0200
+++ b/tests/test-glog.t	Sat Apr 30 19:42:00 2011 +0200
@@ -1425,3 +1425,6 @@
   |
   | o  33
   | |
+  $ hg log -G --follow a
+  abort: -G/--graph option is incompatible with --follow with file argument
+  [255]