push aborts for new branch even if no heads

Luke Opperman loppear at gmail.com
Thu Nov 12 11:22:14 CST 2009


Hi -

Using mercurial 1.3.1 and recent mercurial-crew.

The scenario: trying to push changes that include the creation & subsequent
merging of a branch - the branch has no heads, but push still requires the use
of --force.

Unexpected to me, and especially as the error suggests merging when there is
nothing left to merge. Particularly annoying for downstream forks, as each fork
to be updated with upstream changes will need to use --force when they get this
set of changes. Is there an issue with creating remote headless branches that
I'm missing here, or is this just a bug?

- Luke

Example:

[luke at luke-nb:~/projects/q-test/a]
$ hg init
[luke at luke-nb:~/projects/q-test/a]
$ touch a.txt
[luke at luke-nb:~/projects/q-test/a]
$ hg add
adding a.txt
[luke at luke-nb:~/projects/q-test/a]
$ hg commit -m "one"
[luke at luke-nb:~/projects/q-test/a]
$ hg ll
@  0[tip]   de100d2bcc20   2009-11-12 10:50 -0600   luke
     one

[luke at luke-nb:~/projects/q-test/a]
$ cd ..
[luke at luke-nb:~/projects/q-test]
$ hg clone a b
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[luke at luke-nb:~/projects/q-test]
$ cd a
[luke at luke-nb:~/projects/q-test/a]
$ hg branch t
marked working directory as branch t
[luke at luke-nb:~/projects/q-test/a]
$ touch b.txt
[luke at luke-nb:~/projects/q-test/a]
$ hg addr
adding b.txt
[luke at luke-nb:~/projects/q-test/a]
$ hg commit -m "add b"
[luke at luke-nb:~/projects/q-test/a]
$ hg ll
@  1[tip]   f3befbe2f07b   2009-11-12 10:52 -0600   luke
|    add b
|
o  0   de100d2bcc20   2009-11-12 10:50 -0600   luke
     one

[luke at luke-nb:~/projects/q-test/a]
$ hg co default
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
[luke at luke-nb:~/projects/q-test/a]
$ hg branches
t                              1:f3befbe2f07b
default                        0:de100d2bcc20 (inactive)
[luke at luke-nb:~/projects/q-test/a]
$ hg merge t
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
[luke at luke-nb:~/projects/q-test/a]
$ hg commit -m "merge"
[luke at luke-nb:~/projects/q-test/a]
$ hg ll
@    2[tip]:0,1   7349ba7c894f   2009-11-12 10:52 -0600   luke
|\     merge
| |
| o  1   f3befbe2f07b   2009-11-12 10:52 -0600   luke
|/     add b
|
o  0   de100d2bcc20   2009-11-12 10:50 -0600   luke
     one

[luke at luke-nb:~/projects/q-test/a]
$ hg push ../b
pushing to ../b
searching for changes
abort: push creates new remote branch 't'!
(did you forget to merge? use push -f to force)
[luke at luke-nb:~/projects/q-test/a]



More information about the Mercurial-devel mailing list