[Bug 4381] New: "hg log filename" doesn't include cset that changed the mode

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Sun Sep 21 07:01:09 CDT 2014


http://bz.selenic.com/show_bug.cgi?id=4381

          Priority: normal
            Bug ID: 4381
                CC: faheem at faheem.info, mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: "hg log filename" doesn't include cset that changed
                    the mode
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: ezio.melotti at gmail.com
               URL: https://bitbucket.org/ezio_melotti/hg-log-bug
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.8.2
         Component: Mercurial
           Product: Mercurial

Created attachment 1792
  --> http://bz.selenic.com/attachment.cgi?id=1792&action=edit
sh file to create the test repo

I noticed that one of the files in my repo wasn't executable anymore, and did
"hg log filename" to find out which changeset removed the +x bit, but the
relevant changeset was missing from the output.

"hg help log" doesn't mention anything about changesets that altered the mode,
but since they affect the file I would expect them to be included.

I confirmed this on 2.8.2, but it's been confirmed on #mercurial that the issue
seems to affect Mercurial 3+.

I created a test repo, and the issue can be reproduced by doing:
hg clone https://bitbucket.org/ezio_melotti/hg-log-bug
hg log test.txt --template '{rev}:{node} {desc}'
I also attached a .sh file that can be used to create the repo locally
(untested, I just copied the commands I used to create the test repo).

Here the output doesn't include the two changesets that altered the file mode,
and I would expect them to be there:

$ hg log test.txt --template '{rev}:{node} {desc}\n'
5:816136756249f5bcca8cc8414178f9ea1f4d527c Add a third line to the test file.
3:2976a8c5bc09f9bf1a8b045e15e2e3f6b7562b48 Add another line to the test file.
1:5f34d45a82eb5621d1d3116f7b4031c828188dd0 Add a line to the test file.
0:61d7d36c80d58be7f2f24e5b8a733b944c7ee865 Add test file.


Additionally, if I try
hg log --removed test.txt --template '{rev}:{node} {desc}\n'
all the changesets are showed (including the two that changed the file mode),
even though none of them removed the only file in the repo:

$ hg log --removed test.txt --template '{rev}:{node} {desc}\n'
5:816136756249f5bcca8cc8414178f9ea1f4d527c Add a third line to the test file.
4:7e5702446f0009ba96d14d103373b9ae0e8a98af Restore file mode.
3:2976a8c5bc09f9bf1a8b045e15e2e3f6b7562b48 Add another line to the test file.
2:bbe84a7cb402d3dd583579b6583a154d574e6ac5 Change file mode.
1:5f34d45a82eb5621d1d3116f7b4031c828188dd0 Add a line to the test file.
0:61d7d36c80d58be7f2f24e5b8a733b944c7ee865 Add test file.

This might be a separate bug (let me know if I need to report it separately).


In my repo I also noticed another possible issue.  The file mode got changed
during a merge and restored afterwards with a regular commit.  Even if I use hg
log --removed, the merge cset is not included.  I haven't tried reproducing
this on a test repo.
FWIW the repo is https://bitbucket.org/italianmarssociety/v-eras-blender/ (repo
size is about 150-200MB), the file is test/testtango, the changesets that
changed the mode are 0ec67db (the merge) and 047589d (the regular commit). 
This is the output I get:

# 0ec67db an 047589d are missing
$ hg log --git test/testtango --template '{rev}:{node} {desc}\n'
22:2a4fb8e25775b41c77b94ecf3bae24b4386f308f Add tests for unpolled attributes.
20:f818f8d5d77581c8c555467031a9f58ba2ca4633 Fix test_tango.py.
10:88ca43cea3d332510b8c9c57c7a5ae3ec8bc5cd2 Add tests for Tango and a script to
patch PyTango3.

# only 047589d is included with --remove, 0ec67db is still missing
$ hg log --git --removed test/testtango --template '{rev}:{node} {desc}\n'
57:047589dc07b37edeb17c379936d233fc51b9acf3 Restore modes of testtango that got
accidentally changed in 0ec67db3bcca.
22:2a4fb8e25775b41c77b94ecf3bae24b4386f308f Add tests for unpolled attributes.
20:f818f8d5d77581c8c555467031a9f58ba2ca4633 Fix test_tango.py.
10:88ca43cea3d332510b8c9c57c7a5ae3ec8bc5cd2 Add tests for Tango and a script to
patch PyTango3.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list