hg push with mq applied

Robin Farine robin.farine at terminus.org
Fri May 25 13:04:07 UTC 2007


On Fri May 25 2007 11:29, Bernd Schubert wrote:
> Robin Farine wrote:
> > Hi,
> >
> > On Thu May 24 2007 19:47, Bernd Schubert wrote:
> >> I'm adding patches to a project and I'm doing this on my local
> >> disk. In order store this to save (backuped) storage I would
> >> like to push everything to the backuped dir,  but this fails
> >> with
> >>
> >> abort: source has mq patches applied
> >>
> >> Well I know that it has mq patches applied and I would like to
> >> push these patches as well.
> >
> > But what happens when later you make changes to some of the
> > patches and try to push again ?
>
> Don't know what you mean, I can't push at all, so how should
> changing the patches help?

More explicitly, supposing Hg would accept to push mq managed change
sets (emulated by the "mv .hg/patches/status ..." hack below), what
should Hg do when you push with an applied updated patch:

$ hg init A
$ cd A
$ echo "blah" > blah
$ hg add blah
$ hg commit -m "create blah"
$ cd ..
$ hg clone A B
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd B
$ hg qnew blah.patch
$ echo bli >> blah
$ hg qrefresh
$ mv .hg/patches/status .hg/patches/status.bak
$ hg push default
pushing to /tmp/mq-clone/A
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ mv .hg/patches/status.bak .hg/patches/status
$ vi blah
$ hg qrefresh
$ mv .hg/patches/status .hg/patches/status.bak
$ hg push default
pushing to /tmp/mq-clone/A
searching for changes
abort: push creates new remote branches!
(did you forget to merge? use push -f to force)
$ cd ..
$ hg log -R A
changeset:   1:faa0bb8c87f9
tag:         tip
user:        Robin Farine <robin.farine at terminus.org>
date:        Fri May 25 14:46:52 2007 +0200
summary:     patch queue: blah.patch

changeset:   0:382f96d90a9f
user:        Robin Farine <robin.farine at terminus.org>
date:        Fri May 25 14:46:15 2007 +0200
summary:     create blah

$ hg log -R B
changeset:   1:4d4810ee6122
tag:         tip
user:        Robin Farine <robin.farine at terminus.org>
date:        Fri May 25 14:47:36 2007 +0200
summary:     patch queue: blah.patch

changeset:   0:382f96d90a9f
user:        Robin Farine <robin.farine at terminus.org>
date:        Fri May 25 14:46:15 2007 +0200
summary:     create blah


Should Hg replace change set 1 in A with the one in B or create a new
head ? Or should mq redefine 'push' and 'pull' to cope with this
situation ? What are the implications of each case ?

To me, it seems easier and safer to never publish a repo with mq patches
applied, but publish the patch series separately, perhaps as Gert suggests,
by having the patch queue managed with Hg as well.

Robin



More information about the Mercurial mailing list