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

            Bug ID: 5685
           Summary: backup files can clobber tracked file contents
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: bug
          Priority: wish
         Component: Mercurial
          Assignee: bugzi...@mercurial-scm.org
          Reporter: mbtho...@fb.com
                CC: mercurial-devel@mercurial-scm.org

When backing up files during merge conflict resolution, the backup filename is
just the tracked file with ".orig" appended.  This is bad when the repository
also contains a file with a ".orig" suffix.

Steps to reproduce:

  $ hg init repo
  $ cd repo
  $ echo "important data" > a
  $ echo "old important data" > a.orig
  $ hg add a a.orig
  $ hg commit -m "Add important data"
  $ echo "new important data" > a
  $ hg commit -m "New important data"
  $ hg up -q 0
  $ echo "more important data" > a
  $ hg up 1

At this point, the tracked file "a.orig" has been clobbered with the contents
"more important data".  It shows as modified in the dirstate, and would be
changed if the user committed at this point.

I don't think it's unreasonable for a user to create a file called
"something.orig", even if that seems a bit unusual.  Mercurial also doesn't
complain if it happens.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to