Bug 732 - hg log --follow shows history for removed plus new file with same name
Summary: hg log --follow shows history for removed plus new file with same name
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Nicolas Dumazet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-07 15:44 UTC by Paul Sterk
Modified: 2011-01-30 18:58 UTC (History)
11 users (show)

See Also:
Python Version: ---


Attachments
(33 bytes, text/html)
2007-09-19 10:28 UTC, Paul Sterk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Sterk 2007-09-07 15:44 UTC
To duplicate:

Add and commit a file (e.g., 'test')
Remove and commit 'test'.
Add and commit new file called 'test' that is unrelated to first 'test' file.
Execute hg log -f test

Expected result: to see file history for just the new 'test' file.  
Current result: you see combined file history for both old and new 'test' files.
Comment 1 Dorin Marinca 2007-09-19 09:28 UTC
I find the actual behavior normal and not an issue.
Comment 2 Paul Sterk 2007-09-19 10:28 UTC
On Wed, 2007-09-19 at 15:28 +0000, Dorin Marinca wrote:

> Dorin Marinca <dorin.marinca@gmail.com> added the comment:
> 
> I find the actual behavior normal and not an issue.

Hi,

Could you please explain why?  The two files are unrelated, but have the
same name.  I would like to see the history only for the new file, not
the new + previous.

Thanks,

Paul
Comment 3 Faheem Mitha 2010-04-15 14:03 UTC
Nobody seems very interested in this, but note

$ hg init ex
$ cd ex
$ touch foo; hg add foo; hg ci -m "add foo"
$ hg mv foo bar; hg ci -m "rename foo to bar"
$ hg log foo
changeset:   0:f9aaaebd3638
user:        Faheem Mitha <faheem@email.unc.edu>
date:        Fri Apr 16 00:34:52 2010 +0530
summary:     add foo

This really should fail, because there is no foo 
in parents of wd any longer, and there might be multiple foo's
in history, so this is an ill-defined request. 
This may be the same bug as below, and is certainly related,
hence appending.

                                               Regards, Faheem.
Comment 4 Dorin Marinca 2010-04-16 06:24 UTC
@faheem IMHO you can still:
$ hg update -C 0
and there will be a file 'foo'. So you get a history entry for that.
logs are not correlated with the current state of the repository but rather
it shows all its history and configuration where you can 'update' your
repository.
Comment 5 Nicolas Dumazet 2010-04-23 03:34 UTC
I have a set of patches to fix this issue locally. I'll clean them and post
them to -devel on Monday.
Comment 6 Benoit Boissinot 2010-04-23 04:33 UTC
Did you perf-test them ? :)
Comment 7 Faheem Mitha 2010-06-10 02:17 UTC
nicdumz, what is the status of this?

I recall you sent patches to the ml.
Comment 8 Faheem Mitha 2010-06-10 02:39 UTC
For reference, the patches were posted in a thread to devel starting with

http://markmail.org/message/senwzxdioqq5d6mb

From the thread it seems like one patch was applied, but I think it does not 
solve this issue.
Comment 9 Faheem Mitha 2010-06-28 04:07 UTC
Most recent version of patch at

http://markmail.org/message/3zjkvsoptddb3m6t
Comment 10 HG Bot 2010-08-15 12:00 UTC
Fixed by http://hg.intevation.org/mercurial/crew/rev/99cafcae25d9
Nicolas Dumazet <nicdumz.commits@gmail.com>
log: do not --follow file that is deleted and recreated later (issue732)
Comment 11 Faheem Mitha 2011-01-26 12:44 UTC
Um, the recipe in

http://mercurial.selenic.com/bts/msg12274

is still reproducible as of 1.7.2.

Am I missing something?
Comment 12 kiilerix 2011-01-30 18:58 UTC
faheem: The issue that has been reported and discussed here on this issue
has been solved. If you have another issue then file it as a new issue.

FWIW I think msg12274 shows the intended (and thus (by definition) the
correct) behavior when you don't use --follow. But you might have a point if
--follow is used.
Comment 13 Bugzilla 2012-05-12 08:43 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 08:43 EDT  ---

This bug was previously known as _bug_ 732 at http://mercurial.selenic.com/bts/issue732
Imported an attachment (id=822)