comparison 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
comparison
equal deleted inserted replaced
14085:4852753dae36 14086:2d7cb340a53f
212 return (nullrev, nullrev) 212 return (nullrev, nullrev)
213 return (max(revs), min(revs)) 213 return (max(revs), min(revs))
214 else: 214 else:
215 return (len(repo) - 1, 0) 215 return (len(repo) - 1, 0)
216 216
217 def check_unsupported_flags(opts): 217 def check_unsupported_flags(pats, opts):
218 for op in ["follow_first", "copies", "newest_first"]: 218 for op in ["follow_first", "copies", "newest_first"]:
219 if op in opts and opts[op]: 219 if op in opts and opts[op]:
220 raise util.Abort(_("-G/--graph option is incompatible with --%s") 220 raise util.Abort(_("-G/--graph option is incompatible with --%s")
221 % op.replace("_", "-")) 221 % op.replace("_", "-"))
222 if pats and opts.get('follow'):
223 raise util.Abort(_("-G/--graph option is incompatible with --follow "
224 "with file argument"))
222 225
223 def revset(pats, opts): 226 def revset(pats, opts):
224 """Return revset str built of revisions, log options and file patterns. 227 """Return revset str built of revisions, log options and file patterns.
225 """ 228 """
226 opt2revset = { 229 opt2revset = {
284 287
285 Nodes printed as an @ character are parents of the working 288 Nodes printed as an @ character are parents of the working
286 directory. 289 directory.
287 """ 290 """
288 291
289 check_unsupported_flags(opts) 292 check_unsupported_flags(pats, opts)
290 293
291 revs = revrange(repo, [revset(pats, opts)]) 294 revs = revrange(repo, [revset(pats, opts)])
292 revdag = graphmod.dagwalker(repo, revs) 295 revdag = graphmod.dagwalker(repo, revs)
293 296
294 displayer = show_changeset(ui, repo, opts, buffered=True) 297 displayer = show_changeset(ui, repo, opts, buffered=True)
310 313
311 Nodes printed as an @ character are parents of the working 314 Nodes printed as an @ character are parents of the working
312 directory. 315 directory.
313 """ 316 """
314 317
315 check_unsupported_flags(opts) 318 check_unsupported_flags([], opts)
316 o = hg._outgoing(ui, repo, dest, opts) 319 o = hg._outgoing(ui, repo, dest, opts)
317 if o is None: 320 if o is None:
318 return 321 return
319 322
320 revdag = graphrevs(repo, o, opts) 323 revdag = graphrevs(repo, o, opts)
332 directory. 335 directory.
333 """ 336 """
334 def subreporecurse(): 337 def subreporecurse():
335 return 1 338 return 1
336 339
337 check_unsupported_flags(opts) 340 check_unsupported_flags([], opts)
338 def display(other, chlist, displayer): 341 def display(other, chlist, displayer):
339 revdag = graphrevs(other, chlist, opts) 342 revdag = graphrevs(other, chlist, opts)
340 showparents = [ctx.node() for ctx in repo[None].parents()] 343 showparents = [ctx.node() for ctx in repo[None].parents()]
341 generate(ui, revdag, displayer, showparents, asciiedges) 344 generate(ui, revdag, displayer, showparents, asciiedges)
342 345