[Bug 3874] New: qimport'ing series of public commits may leave MQ in inconsistent state

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Sat Mar 30 02:31:19 CDT 2013


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

          Priority: normal
            Bug ID: 3874
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: qimport'ing series of public commits may leave MQ in
                    inconsistent state
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: immerrr+mercurial at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.5
         Component: mq
           Product: Mercurial

It sometimes happens in my workflow that I need to hotfix some things remotely,
and in order to make those changes adhere to guidelines before pushing into
mainline, I'd like to "finalize" them locally.  But after I pull the commits
back to local repo those changes are in public phase and MQ doesn't play well
with that.

Steps to reproduce (copy-and-paste-into-terminal-friendly):

# 1 Initialize repo1
# ==================
hg init repo1
echo foobar >> repo1/file.txt
hg --cwd repo1 ci  -m 'initial commit' --addremove --config ui.username=foo

# 2 Clone repo1 to repo2 and make some modifications there
# ========================================================
hg clone repo1 repo2
echo barbaz >> repo2/file.txt
hg --cwd repo2 ci -m 'hotfix #1' --addremove --config ui.username=foo
echo quxquux >> repo2/file.txt
hg --cwd repo2 ci -m 'hotfix #2' --addremove --config ui.username=foo

# 3 Propagate changes back to repo1
# =================================
hg --cwd repo1 pull ../repo2

# 4 Try to alter incoming changes
# ===============================
cd repo1
hg glog
hg qimp -r 1:2

# The last command from above fails (explicably) with:
#   abort: revision 2 is not mutable
#   (see "hg help phases" for details)

# 5 Ok, we know that r2 isn't really public, let's try to convince mercurial
# ==========================================================================
hg phase --draft --force -r2
hg qimp -r 1:2

# Oh, forgot about another mutable revision:
#   abort: revision 1 is not mutable
#   (see "hg help phases" for details)

# Let's fix that too:
hg phase --draft --force -r1

# 6 No more public revisions, everything should be fine now, let's try again
# ==========================================================================
hg qimp -r 1:2

# Failure:
#    abort: patch "2.diff" already exists

# 7 Whoops, MQ is inconsistent state: 2.diff was imported, but series is empty
# ============================================================================
ls .hg/patches/
hg qseries

# 8 Let's fix that
# ================
rm .hg/patches/2.diff

# 9 Ok, it finally works
# ======================
hg qimp -r 1:2
ls .hg/patches/
hg qseries

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


More information about the Mercurial-devel mailing list