[Bug 3691] New: status can report unchanged files as modified when comparing two changesets
bugzilla-daemon at bz.selenic.com
bugzilla-daemon at bz.selenic.com
Fri Nov 2 13:04:06 CDT 2012
http://bz.selenic.com/show_bug.cgi?id=3691
Priority: normal
Bug ID: 3691
CC: mercurial-devel at selenic.com
Assignee: bugzilla at selenic.com
Summary: status can report unchanged files as modified when
comparing two changesets
Severity: bug
Classification: Unclassified
OS: All
Reporter: patrick at mezard.eu
Hardware: All
Status: UNCONFIRMED
Version: unspecified
Component: Mercurial
Product: Mercurial
Here is a simple test setting a file, modifying it and reverting it. A status
call between the first and last changeset reports the file as modified.
It comes from the following condition:
http://hg.intevation.org/mercurial/crew/file/8ef4b022d562/mercurial/localrepo.py#l1627
Which can be fixed by this patch:
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1624,8 +1624,7 @@
if fn in mf1:
if (fn not in deleted and
((fn in withflags and mf1.flags(fn) != mf2.flags(fn))
or
- (mf1[fn] != mf2[fn] and
- (mf2[fn] or ctx1[fn].cmp(ctx2[fn]))))):
+ (mf1[fn] != mf2[fn] and ctx1[fn].cmp(ctx2[fn])))):
modified.append(fn)
elif listclean:
clean.append(fn)
File nodes may be different but have identical files content. There is no way
to fastpath that.
This change triggers two failures in:
Failed test-convert-hg-source.t: output changed
Failed test-convert-filemap.t: output changed
which I do not have the time to investigate right now.
$ hg init repo
$ cd repo
ABA sequence of file changes
$ echo a > a
$ hg ci -Am adda
adding a
$ echo a >> a
$ hg ci -m changea
$ echo a > a
$ hg st --rev 0
$ hg ci -m reverta
$ hg log -G --template '{rev} {desc}\n'
@ 2 reverta
|
o 1 changea
|
o 0 adda
$ hg st --rev 0:2
M a
$ hg cat -r 0 a
a
$ hg cat -r 2 a
a
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Mercurial-devel
mailing list