diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -1106,15 +1106,7 @@ def walkchangerevs(repo, match, opts, pr 'filenames')) # The slow path checks files modified in every changeset. - if opts.get('removed'): - # --removed wants to yield the changes where the file - # was removed, this means that we have to explore all - # changesets, effectively ignoring the revisions that - # had been passed as arguments - revlist = xrange(nullrev, len(repo) - 1) - else: - revlist = sorted(revs) - for i in revlist: + for i in sorted(revs): ctx = change(i) matches = filter(match, ctx.files()) if matches: diff --git a/tests/test-log b/tests/test-log --- a/tests/test-log +++ b/tests/test-log @@ -62,6 +62,11 @@ hg log -v --template '{rev} {file_copies echo '% log -p d' hg log -pv d +echo '% log --removed file' +hg log --removed -v a +echo '% log --removed revrange file' +hg log --removed -v -r0:2 a + # log --follow tests hg init ../follow cd ../follow diff --git a/tests/test-log.out b/tests/test-log.out --- a/tests/test-log.out +++ b/tests/test-log.out @@ -196,6 +196,32 @@ diff -r 41dd4284081e -r 7c6c671bb7cc d @@ -0,0 +1,1 @@ +a +% log --removed file +changeset: 3:7c6c671bb7cc +user: test +date: Thu Jan 01 00:00:04 1970 +0000 +files: a b d +description: +d + + +changeset: 0:8580ff50825a +user: test +date: Thu Jan 01 00:00:01 1970 +0000 +files: a +description: +a + + +% log --removed revrange file +changeset: 0:8580ff50825a +user: test +date: Thu Jan 01 00:00:01 1970 +0000 +files: a +description: +a + + adding base 1 files updated, 0 files merged, 0 files removed, 0 files unresolved adding b1