head problem (bitbucket) push -f

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

head problem (bitbucket) push -f

Uwe Brauer
Hi

I thought control my local repos, but alas, I can't (again) push to
bitbucket

The message is
abort: push creates new remote branches: year-2017-2018!
(use 'hg push --new-branch' to create new remote branches)

Which is ok since I have created a new branch
hg push --new-branch

Gives


remote has heads on branch 'exam-sep-17' that are not known locally: 6ef15d23440d
abort: push creates new remote head 9e3d909270e5 on branch 'exam-sep-17'!
(pull and merge or see 'hg help push' for details about pushing new heads)

Well in the local repo I have 7 named branches but 9 heads.

I cloned the bitbucket repo and the problem seems to be in the
exam-sep-17 branch.

So in the bitbucket clone

Hg log -b exam-sep-17 gives

changeset:   372:fcdc0ba385ef
branch:      exam-sep-17


changeset:   370:9e3d909270e5
branch:      exam-sep-17
user:        Uwe Brauer <[hidden email]>
date:        Tue Oct 17 15:07:17 2017 +0200
summary:     Upgrade header

             

Which in the local branch I only have


Hg log -b exam-sep-17 gives
changeset:   370:9e3d909270e5
branch:      exam-sep-17
user:        Uwe Brauer <[hidden email]>
date:        Tue Oct 17 15:07:17 2017 +0200
summary:     Upgrade header

changeset:   369:5f607cb46909
branch:      exam-sep-17
parent:      367:cee65fe47a62
user:        Uwe Brauer <[hidden email]>
date:        Tue Oct 17 15:06:12 2017 +0200
summary:     Upgrade year

changeset:   368:fcdc0ba385ef
branch:      exam-sep-17
user:        Uwe Brauer <[hidden email]>
date:        Sun Oct 15 21:36:23 2017 +0200
summary:     Change structure HG file

So I thought I run in local

Hg up exam-sep-17
hg pull -u
hg merge

And then hg push --new-branch.

Is this a good idea, because I have to feeling I create more and more
heads.

Thanks

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: head problem (bitbucket) push -f

James Reynolds


On Wed, Oct 18, 2017 at 1:20 PM, Uwe Brauer <[hidden email]> wrote:
Hi

I thought control my local repos, but alas, I can't (again) push to
bitbucket

The message is
abort: push creates new remote branches: year-2017-2018!
(use 'hg push --new-branch' to create new remote branches)

Which is ok since I have created a new branch
hg push --new-branch

Gives


remote has heads on branch 'exam-sep-17' that are not known locally: 6ef15d23440d
abort: push creates new remote head 9e3d909270e5 on branch 'exam-sep-17'!
(pull and merge or see 'hg help push' for details about pushing new heads)

Well in the local repo I have 7 named branches but 9 heads.

I cloned the bitbucket repo and the problem seems to be in the
exam-sep-17 branch.

So in the bitbucket clone

Hg log -b exam-sep-17 gives

changeset:   372:fcdc0ba385ef
branch:      exam-sep-17


changeset:   370:9e3d909270e5
branch:      exam-sep-17
user:        Uwe Brauer <[hidden email]>
date:        Tue Oct 17 15:07:17 2017 +0200
summary:     Upgrade header



Which in the local branch I only have


Hg log -b exam-sep-17 gives
changeset:   370:9e3d909270e5
branch:      exam-sep-17
user:        Uwe Brauer <[hidden email]>
date:        Tue Oct 17 15:07:17 2017 +0200
summary:     Upgrade header

changeset:   369:5f607cb46909
branch:      exam-sep-17
parent:      367:cee65fe47a62
user:        Uwe Brauer <[hidden email]>
date:        Tue Oct 17 15:06:12 2017 +0200
summary:     Upgrade year

changeset:   368:fcdc0ba385ef
branch:      exam-sep-17
user:        Uwe Brauer <[hidden email]>
date:        Sun Oct 15 21:36:23 2017 +0200
summary:     Change structure HG file

So I thought I run in local

Hg up exam-sep-17
hg pull -u
hg merge

And then hg push --new-branch.

Is this a good idea, because I have to feeling I create more and more
heads.

Thanks

Uwe Brauer

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial


that looks mostly right to me, except i'm not sure why you need the new branch?

I think all you need do in this case is:

hg up exam-sep-17;
hg pull;
hg merge;
`hg push -b .`

(note the . at the end is significant)

You are probably pushing from two sources (say a work computer and then a home laptop)

You made some changes at "work" and your "laptop" doesn't know about them.

it's a good practice to do a `hg in` prior to working on new stuff to avoid merges just to see if remote knows about stuff that your local doesn't.

You also probably don't need to do hg pull -u. In fact it may just confuse things. Your going to get a new head when you pull.

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial
Reply | Threaded
Open this post in threaded view
|

Re: head problem (bitbucket) push -f

Uwe Brauer

    > On Wed, Oct 18, 2017 at 1:20 PM, Uwe Brauer <[hidden email]> wrote:


    > that looks mostly right to me,
Thanks


    > I think all you need do in this case is:

    > hg up exam-sep-17;
    > hg pull;
    > hg merge;
    > `hg push -b .`

I just that command a while ago but forgot about it. Remind me, please,
what is the purpose of . ?


(google did not return anything useful at first glance.)

    > (note the . at the end is significant)

    >  except i'm not sure why you need the new
    > branch?


Well I created that new branch on my local repo and committed some
changes, so bitbucket forces me to push the new branch (which makes some
sense)

    > You are probably pushing from two sources (say a work computer and
    > then a home laptop)

right
    > You made some changes at "work" and your "laptop" doesn't know
    > about them.

    > it's a good practice to do a `hg in` prior to working on new stuff
    > to avoid merges just to see if remote knows about stuff that your
    > local doesn't.

Yeah I even tell this my collaborators for common repos, and then I
forget it myself. Sigh.

    > You also probably don't need to do hg pull -u. In fact it may just
    > confuse things. Your going to get a new head when you pull.

Well yes and no, sometimes I commit to the wrong branch and I thought
pull -u is a good way to avoid that, but now I am not so sure.

Uwe

_______________________________________________
Mercurial mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial