[Bug 4028] New: Graft fails when files have been moved in an ancestor revision

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Fri Aug 30 07:23:31 CDT 2013


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

          Priority: normal
            Bug ID: 4028
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Graft fails when files have been moved in an ancestor
                    revision
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: jeberger at free.fr
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.7
         Component: Mercurial
           Product: Mercurial

If I have two branches, one tracking historical development and one in which I
am refactoring and in which I have moved files to other folders, then I can't
graft a revision from the refactor branch to the main branch directly. I can
however graft the revision if I first create a temporary branch in which I
backout the move, then graft to the temporary branch from the refactor branch
and finally graft to the default branch from the temporary branch.

The following script shows the issue:

   #!/bin/sh
   export HGRCPATH=
   hg init
   echo foo > foo
   echo bar > bar
   hg addremove
   hg ci -u me -m "Initial commit"
   hg branch refactor
   mkdir src
   hg mv foo bar src
   hg ci -u me -m "Moved sources to src"
   hg up default
   echo baz >> foo
   hg ci -u me -m "Dev goes on on the default branch"
   hg up refactor
   hg merge default
   hg ci -u me -m "Merge"
   echo whatever >> src/foo
   hg ci -u me -m "Fixed an issue in branch refactor"
   hg up default
   ####################################################################
   echo
   echo
   echo The next command will fail, hit Ctrl-C to exit
   echo
   hg graft refactor

   ####################################################################
   echo
   echo
   echo This workaround will work
   echo
   hg up -C refactor^
   hg backout 1
   hg branch tmp
   hg ci -u me -m "Backed out"
   hg graft refactor
   hg up default
   hg graft tmp

Note that this may be related to bug #3409 (the summary matches, but the
description appears to be something quite different).

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


More information about the Mercurial-devel mailing list