I did a series of dumb steps with my local copy of our shared repository, and I'm looking for a way how to fix it. The steps are:
I used bookmarks to have multiple heads of a development branch, that other people use:
-o---o---o-----o--- <- dev branch \----1----1------ <- another head of the dev branch, where I committed stuff
I created a new branch, still local, some time later
/---------------x <- new branch -o---o---o-----o--- <- dev branch \----1----1------ <- another head of the dev branch, where I committed stuff
for one head, that contains only my code, I did a rebase on another branch
/-1'--1'-- <- rebase /---------------x <- new branch -o---o---o-----o--- <- dev branch \----1----1------ <- another head of the dev branch, where I committed stuff
then, I merged the rebase, and then, a couple of commits later, I merged default
----------d-\ <-default \ /-1'--1'\ \ /---------------x--------x--x-x-x-- <- new branch -o---o---o-----o--- \----1----1------
Now, I wanted to push my new branch to the server (hg push --new-branch -b newBranch
), but I get abort: push creates new remote head
, since commits 1'
belong to dev branch.
What is the right thing to do? I would like to avoid creating this additional head.
Update:
Per request, this is the output of hg heads
:
changeset: 839:f2033d695fcd <- want to push this
branch: newBranch
tag: tip
user: me
date: Wed Oct 31 13:05:51 2012 +0100
changeset: 826:7fde19d7f467
branch: devBranch
user: my-collegue
date: Tue Oct 23 14:59:42 2012 +0200
changeset: 820:23853bbf68df <- the part after rebase that got merged
branch: devBranch
user: me
date: Mon Oct 22 15:36:26 2012 +0200
changeset: 807:899344cfb145 <- obsolete (branch with 1's)
branch: devBranch
parent: 711:454f29c03fb1
user: me
date: Mon Oct 22 15:36:26 2012 +0200
changeset: 712:d5e8a62a7f5f <- default, needs to stay
parent: 648:2bbcc01aa191
user: me
date: Wed Aug 22 16:21:09 2012 +0200
hg log
orhg glog
for tree here and at stackoverflow.com/questions/11982648/…, for example). For now, please, add output ofhg heads
with comment - which head is obsolete and must not exist (totally or only in push-target). Also read about -r option in push command – Lazy Badgerlog
as there are much more commits than I described, and I also forgot the exact commands I executed in order to get to this state... Question updated to contain the output of heads. I don't understand your reference to-r
option, how/why should it help? – Nikola Knezevicpush -r f2033d695fcd
will be enough – Lazy Badgerhg push -r f2033d695fcd --new-branch
, I getabort: push creates new remote head 23853bbf68df on branch devBranch
. This is what I'm trying to avoid. – Nikola Knezevic