[Bug 4058] New: `hg status --copies --rev R1 --rev R2` can have different output in different clones of the same repo

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Oct 10 19:40:05 UTC 2013


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

          Priority: normal
            Bug ID: 4058
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: `hg status --copies --rev R1 --rev R2` can have
                    different output in different clones of the same repo
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: mkoconnor at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.7
         Component: Mercurial
           Product: Mercurial

A command `hg status --copies --rev R1 --rev R2` can report copies differently
in different clones of the same repo.  I believe this is because in copies.py,
the _tracefile function will stop looking backwards based on the numerical
revision, rather than the hash.

Here's a reproduction:

Set up first repo:
  $ hg init t1
  $ cd t1
  $ touch a
  $ hg add a
  $ hg commit -m 'add a'
  $ hg mv a b
  $ hg commit -m 'mv a b'
  $ echo foo > b
  $ hg commit -m 'alter b'
  $ hg update 0
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ touch c
  $ hg add c
  $ hg commit -m 'make irrelevant change'
  created new head
  $ hg book -i R1
  $ hg merge 2
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  (branch merge, don't forget to commit)
  $ hg book -i R2
  $ hg status --copies --rev R1 --rev R2
  A b
  R a

Now pull the changesets in a different order and get a different result:
  $ cd ..
  $ hg clone -r R1 t1 t2
  adding changesets
  adding manifests
  adding file changes
  added 2 changesets with 2 changes to 2 files
  updating to branch default
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd t2
  $ hg pull -r R2
  pulling from /mnt/local/sda1/moconnor/t1
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 3 changesets with 2 changes to 1 files
  adding remote bookmark R2
  (run 'hg update' to get a working copy)
  $ hg status --copies --rev R1 --rev R2
  A b
    a
  R a

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



More information about the Mercurial-devel mailing list