[Bug 5721] New: hg log <file> doesn't show changeset with same change as previous changeset

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Wed Oct 25 20:39:35 UTC 2017


https://bz.mercurial-scm.org/show_bug.cgi?id=5721

            Bug ID: 5721
           Summary: hg log <file> doesn't show changeset with same change
                    as previous changeset
           Product: Mercurial
           Version: stable branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: fastcat at gmail.com
                CC: mercurial-devel at mercurial-scm.org

If two changesets make the same change to a file, hg log <file> only shows one
of them, even if the changesets have other differences, such as branch name,
timestamp, or the changes made to other files.

Minimal test case:

Setup:
  cd $(mktemp -d)
  hg init
  echo a > file.txt
  hg ci -Am base

Basic test case:
  for b in t1 t2 t3 ; do
    hg up -C default ; hg branch $b ; echo a b >file.txt ; hg ci -m $b
  done
  hg log file.txt
  # Ought to list all the commits
  # Only actually lists the base and t1 commits
You can extend this to as many branches/copies as you want...

More complex test case to ensure all the file trees are different:
  for b in t1 t2 t3 ; do
    hg up -C default ; hg branch $b ; echo a b >file.txt ; echo $b > $b.txt ;
hg ci -Am $b
  done
  # results of this are the same as the simpler test case

Other observations:
* hg log --follow file.txt does not show the "extra" commits
* hg log --removed file.txt perversely *does* show the extra commits ... even
though none of these commits removed anything?!
* hg log -r "file('file.txt')" also shows all the commits
* Inserting other commits on each branch before creating the following branch
with the same change does not affect the results
* Explicitly specifying -r 0:tip to hg log does not affect the output
* Even explicitly listing only one of the secondary commits does not affect the
output, e.g. hg log -r 2 file.txt produces *no* output

$ hg --version
Mercurial Distributed SCM (version 4.0)
$ apt-show-versions -p mercurial
mercurial:amd64/stretch 4.0-1+deb9u1 uptodate

Since I normally run with quite a few extensions enabled, I tried disabling all
of them and verified this behavior persisted unchanged in that "clean" setup

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


More information about the Mercurial-devel mailing list