# HG changeset patch # User Brendan Cully # Date 1154636971 25200 # Node ID 2e0cd25fe4aca4e92f5278175b0ecfb4940d98bd # Parent 21e571c21a6bb37be6557feddb611452368dc539 Make log --follow revision range start default to working dir parent. diff -r 21e571c21a6b -r 2e0cd25fe4ac mercurial/commands.py --- a/mercurial/commands.py Thu Aug 03 11:06:09 2006 -0700 +++ b/mercurial/commands.py Thu Aug 03 13:29:31 2006 -0700 @@ -130,7 +130,17 @@ if repo.changelog.count() == 0: return [], False, matchfn - revs = map(int, revrange(ui, repo, opts['rev'] or ['tip:0'])) + if follow: + p = repo.dirstate.parents()[0] + if p == nullid: + ui.warn(_('No working directory revision; defaulting to tip\n')) + start = 'tip' + else: + start = repo.changelog.rev(p) + defrange = '%s:0' % start + else: + defrange = 'tip:0' + revs = map(int, revrange(ui, repo, opts['rev'] or [defrange])) wanted = {} slowpath = anypats fncache = {} @@ -2017,6 +2027,10 @@ renames and copies. --follow without a file name will only show ancestors or descendants of the starting revision. + If no revision range is specified, the default is tip:0 unless + --follow is set, in which case the working directory parent is + used as the starting revision. + By default this command outputs: changeset id and hash, tags, non-trivial parents, user, date and time, and a summary for each commit. When the -v/--verbose switch is used, the list of changed