# HG changeset patch # User Patrick Mezard # Date 2011-04-30 17:42:00 # Node ID 2d7cb340a53f01f181e4b3b9a9e5310772996a3f # Parent 4852753dae360790878d1ebb7319049096dde269 graphlog: log -G --follow file does not work, forbid it We do not have revsets to follow file history. diff --git a/hgext/graphlog.py b/hgext/graphlog.py --- a/hgext/graphlog.py +++ b/hgext/graphlog.py @@ -214,11 +214,14 @@ def get_revs(repo, rev_opt): 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 @@ def graphlog(ui, repo, *pats, **opts): 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 @@ def goutgoing(ui, repo, dest=None, **opt 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 gincoming(ui, repo, source="default" 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()] diff --git a/tests/test-glog.t b/tests/test-glog.t --- a/tests/test-glog.t +++ b/tests/test-glog.t @@ -1425,3 +1425,6 @@ Test log -G options | | o 33 | | + $ hg log -G --follow a + abort: -G/--graph option is incompatible with --follow with file argument + [255]