[issue2896] Inconsistent view from hg log

Paul Nathan bugs at mercurial.selenic.com
Mon Jul 11 18:25:16 CDT 2011


New submission from Paul Nathan <paul_nathan at selinc.com>:

Hi,

hg log produces inconsistent output, depending on if you asked it for the log of a file, or only a repository.

Specifically, the log of the 'repository' denotes trivial (no-change) merges as a modification to a file, whereas the log of the file will 
not necessarily do that.  This has posed some difficulty for internal source code repository analysis.

I have here a test run to demonstrate the issue; whitespace has been added. 

The first log is the repo-wide log, the second log is the file-wide log.

hg version 1.8.4 on Ubuntu 10.10. 


paulnath at paulnathlinux:~/temp
$ mkdir testrepo
paulnath at paulnathlinux:~/temp
$ cd testrepo/
paulnath at paulnathlinux:~/temp/testrepo
$ hg init
paulnath at paulnathlinux:~/temp/testrepo
$ ls > f
paulnath at paulnathlinux:~/temp/testrepo
$ hg add f
paulnath at paulnathlinux:~/temp/testrepo
$ ls > g
paulnath at paulnathlinux:~/temp/testrepo
$ hg add g
paulnath at paulnathlinux:~/temp/testrepo
$ hg commit -m "stuff"
paulnath at paulnathlinux:~/temp/testrepo
$ hg branch some_branch
marked working directory as branch some_branch
paulnath at paulnathlinux:~/temp/testrepo
$ ls >> f
paulnath at paulnathlinux:~/temp/testrepo
$ hg commit -m "new branch"
paulnath at paulnathlinux:~/temp/testrepo
$ hg up default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
paulnath at paulnathlinux:~/temp/testrepo
$ hg merge some_branch 
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
paulnath at paulnathlinux:~/temp/testrepo
$ hg commit -m "merge"
paulnath at paulnathlinux:~/temp/testrepo
$ hg glog
@    changeset:   2:6194cf569aba
|\   tag:         tip
| |  parent:      0:7cdf18176912
| |  parent:      1:3a504add2645
| |  user:        paulnath
| |  date:        Mon Jul 11 16:17:14 2011 -0700
| |  summary:     merge
| |
| o  changeset:   1:3a504add2645
|/   branch:      some_branch
|    user:        paulnath
|    date:        Mon Jul 11 16:16:54 2011 -0700
|    summary:     new branch
|
o  changeset:   0:7cdf18176912
   user:        paulnath
   date:        Mon Jul 11 16:16:38 2011 -0700
   summary:     stuff


paulnath at paulnathlinux:~/temp/testrepo
$ hg -v log --style=xml


<?xml version="1.0"?>
<log>
<logentry revision="2" node="6194cf569abac3b811490bfe6f67e529f6c035ea">
<tag>tip</tag>
<parent revision="0" node="7cdf1817691275bc32d17a0b2c2ef1aa79c0cd65" />
<parent revision="1" node="3a504add26452067bdcb4542caaf98a79163e308" />
<author email="paulnath">paulnath</author>
<date>2011-07-11T16:17:14-07:00</date>
<msg xml:space="preserve">merge</msg>
<paths>
<path action="M">f</path>
</paths>
</logentry>

<logentry revision="1" node="3a504add26452067bdcb4542caaf98a79163e308">
<branch>some_branch</branch>
<author email="paulnath">paulnath</author>
<date>2011-07-11T16:16:54-07:00</date>
<msg xml:space="preserve">new branch</msg>
<paths>
<path action="M">f</path>
</paths>
</logentry>

<logentry revision="0" node="7cdf1817691275bc32d17a0b2c2ef1aa79c0cd65">
<author email="paulnath">paulnath</author>
<date>2011-07-11T16:16:38-07:00</date>
<msg xml:space="preserve">stuff</msg>
<paths>
<path action="A">f</path>
<path action="A">g</path>
</paths>
</logentry>
</log>



paulnath at paulnathlinux:~/temp/testrepo
$ hg -v log f --style=xml


<?xml version="1.0"?>
<log>
<logentry revision="1" node="3a504add26452067bdcb4542caaf98a79163e308">
<branch>some_branch</branch>
<author email="paulnath">paulnath</author>
<date>2011-07-11T16:16:54-07:00</date>
<msg xml:space="preserve">new branch</msg>
<paths>
<path action="M">f</path>
</paths>
</logentry>

<logentry revision="0" node="7cdf1817691275bc32d17a0b2c2ef1aa79c0cd65">
<author email="paulnath">paulnath</author>
<date>2011-07-11T16:16:38-07:00</date>
<msg xml:space="preserve">stuff</msg>
<paths>
<path action="A">f</path>
<path action="A">g</path>
</paths>
</logentry>
</log>

----------
messages: 16792
nosy: paulnath
priority: bug
status: unread
title: Inconsistent view from hg log

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2896>
____________________________________________________


More information about the Mercurial-devel mailing list