MercurialQueues patch merging broken?

Giorgos Keramidas keramida at ceid.upatras.gr
Mon May 14 04:31:49 CDT 2007


On 2007-05-13 19:17, Brendan Cully <brendan at kublai.com> wrote:
> On Monday, 14 May 2007 at 04:30, Giorgos Keramidas wrote:
> > > I'd prefer to find a different approach than backing out my
> > > fix, even if it causes you problems with merging patch
> > > queues.  Merging is much less frequent (I never do it) than
> > > hitting ^C while pushing, and the consequences of ^C are a
> > > terrible mess without my patch.  The merge feature is
> > > unusably complex as it stands, so you're possibly the only
> > > person being affected by this :-(
> > 
> > Agreed.  I am probably too sleepy to really find a fix now, so I
> > will look at the merge issue again when I get a good night's
> > sleep.  In the meantime, please everyone let's not push anywhere
> > the backout.  It was only a temporary 'local hack' to see if I
> > could fix the issue I was seeing...
> 
> Looks like a one-liner (but I doubt qpush -m is doing the right thing
> for ^C -- that'll have to be a later patch).

Indeed.  I have verified that the change below fixes MQ merging,
and that all the tests complete successfully after the change:

    $ env GATEREPO=/home/keramida/hg/mercurial/brendan \
          sh ~/cron.d/mercurial-test.sh
    2007-05-14 09:23:56 -- Gate repository is at /home/keramida/hg/mercurial/brendan
    2007-05-14 09:23:56 -- Creating temporary test workspace at /tmp/crewXXXX
    2007-05-14 09:23:56 -- Initializing test workspace at /tmp/hgtest-jlq8
    2007-05-14 09:23:56 -- Pulling changesets from gate repo at /home/keramida/hg/mercurial/brendan
    pulling from /home/keramida/hg/mercurial/brendan
    requesting all changes
    adding changesets
    adding manifests
    adding file changes
    added 4438 changesets with 8514 changes to 608 files
    (run 'hg update' to get a working copy)
    2007-05-14 09:24:08 -- Gate tip is a210b40d0860
    2007-05-14 09:24:08 -- Checking out clean copy of a210b40d0860 revision
    526 files updated, 0 files merged, 0 files removed, 0 files unresolved
    2007-05-14 09:24:11 -- Running the Mercurial test suite.
    2007-05-14 09:24:11 -- Extra run-tests.py flags: (none)
    .................[...]
    # Ran 155 tests, 0 skipped, 1 failed.
    2007-05-14 09:31:10 -- Removing test workspace from /tmp/hgtest-jlq8

Thanks for the quick fix :-)

> # HG changeset patch
> # User Brendan Cully <brendan at kublai.com>
> # Date 1179108954 25200
> # Node ID a210b40d0860b8fa6b5762e1542dfdc9ee61b4f5
> # Parent  a764edb6fc952e620438a6c7a8cc10bcffe80039
> Make mergepatch save queue now that qpush isn't.
> 
> diff -r a764edb6fc95 -r a210b40d0860 hgext/mq.py
> --- a/hgext/mq.py	Thu May 10 13:42:36 2007 -0700
> +++ b/hgext/mq.py	Sun May 13 19:15:54 2007 -0700
> @@ -417,6 +417,7 @@ class queue:
>                  self.applied_dirty = 1
>              if err:
>                  return (err, head)
> +        self.save_dirty()
>          return (0, head)
>  
>      def patch(self, repo, patchfile):
> diff -r a764edb6fc95 -r a210b40d0860 tests/test-mq-merge
> --- a/tests/test-mq-merge	Thu May 10 13:42:36 2007 -0700
> +++ b/tests/test-mq-merge	Sun May 13 19:15:54 2007 -0700
> @@ -37,3 +37,6 @@ hg manifest
>  hg manifest
>  hg qpush -a -m 2>&1 | rewrite_path
>  hg manifest
> +
> +# ensure status is correct after merge
> +hg qpop -a
> diff -r a764edb6fc95 -r a210b40d0860 tests/test-mq-merge.out
> --- a/tests/test-mq-merge.out	Thu May 10 13:42:36 2007 -0700
> +++ b/tests/test-mq-merge.out	Sun May 13 19:15:54 2007 -0700
> @@ -9,3 +9,4 @@ applying rm_a
>  applying rm_a
>  Now at: rm_a
>  b
> +Patch queue now empty


More information about the Mercurial-devel mailing list