graphlog: log -G --follow file does not work, forbid it

We do not have revsets to follow file history.
This commit is contained in:
Patrick Mezard 2011-04-30 19:42:00 +02:00
parent f59a4cb18e
commit 57542c9154
2 changed files with 10 additions and 4 deletions

View File

@ -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, **opts):
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", **opts):
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()]

View File

@ -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]