[Bug 5629] New: Update's changed/deleted/unresolved prompt erroneously drops file from dirstate if (d) is chosen

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Sun Jul 23 17:31:24 UTC 2017


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

            Bug ID: 5629
           Summary: Update's changed/deleted/unresolved prompt erroneously
                    drops file from dirstate if (d) is chosen
           Product: Mercurial
           Version: 4.3-rc
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: bug
          Priority: normal
         Component: Mercurial
          Assignee: bugzilla at mercurial-scm.org
          Reporter: matt_harbison at yahoo.com
                CC: mercurial-devel at mercurial-scm.org

This causes status, diff, etc to be wrong.  It takes a `debugrebuilddirstate`
to recover.  I first noticed this in subrepos[1], but this is a simplified test
without them:

  $ hg init x
  $ touch x/file
  $ hg ci -R x -Aqm add
  $ echo 'mod' > x/file
  $ hg -R x ci -Am modify
  $ rm x/file
  $ hg -R x up '.^' --config ui.interactive=True << EOF
  > d
  > EOF
  other [destination] changed file which local [working copy] deleted
  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? d
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved

  $ ls x
  $ hg st -R x
  $ hg -R x debugdirstate
  $ hg -R x debugrebuilddirstate
  $ hg st -R x
  ! file

It looks like merge.recordupdates() is dropping the file from dirstate[2] in
this case.  

[1]
https://www.mercurial-scm.org/repo/hg/file/4.3-rc/tests/test-merge-subrepos.t#l116
[2] https://www.mercurial-scm.org/repo/hg/file/4.3-rc/mercurial/merge.py#l1398

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


More information about the Mercurial-devel mailing list