help unwinding an hg-git goof

瀏覽次數:11 次
跳到第一則未讀訊息

Chuck Tuffli

未讀,
2021年8月3日 下午6:00:122021/8/3
收件者:hg-git
I'm maintaining an open source application hosted on heptapod that I
manually mirrored to github. At one point, I accepted and merged a
pull request on github but never merged those changes back to the
Mercurial repo. Since then, I have pushed additional change to
heptapod and now am getting errors when pushing to github:

$ hg push git+ssh://g...@github.com/ctuffli/smart.git
pushing to git+ssh://g...@github.com/ctuffli/smart.git
X11 forwarding request failed on channel 0
searching for changes
abort: branch 'refs/heads/main' changed on the server, please pull and
merge before pushing

I'm assuming this is because of the divergent history. My question is,
what is the best way to unwind the mess I've created? TIA

--chuck

Pierre-Yves David

未讀,
2021年8月4日 下午1:34:102021/8/4
收件者:hg-...@googlegroups.com、Chuck Tuffli
You can probably nuke all content specific to github (using git push
--force) and let heptapod re-push new content.

Did you tried that ?
--
Pierre-Yves David

Chuck Tuffli

未讀,
2021年8月6日 上午11:08:562021/8/6
收件者:Pierre-Yves David、hg-git
On Wed, Aug 4, 2021 at 10:34 AM Pierre-Yves David
<pierre-y...@ens-lyon.org> wrote:
>
> You can probably nuke all content specific to github (using git push
> --force) and let heptapod re-push new content.
>
> Did you tried that ?

That is one approach I considered, but I wanted to see if there was a
way to 'fix' (modify) the Mercurial history to combine the two.
histedit is something I've used in the past, but it complained that it
"cannot edit public changesets". I know this isn't recommended, but if
I wanted to modify the Mercurial history, would I need to force the
phases of the commits in question to draft? Is there an
easier/better/... tool than histedit?

--chuck

Dan Villiom Podlaski Christiansen

未讀,
2021年8月6日 下午1:58:362021/8/6
收件者:hg-...@googlegroups.com、Pierre-Yves David
Before I try to debug this, I wanted to ask a question: Did you try following the advice, and do an 'hg pull'? If not, could you explain why? Perhaps the message is unhelpful or misleading?

--
You received this message because you are subscribed to the Google Groups "hg-git" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hg-git+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hg-git/CAKAYmM%2BfvOu-f%3DTva1_dqTJOFOOU%3Dy4SCf4TE9yN3Y3LReGq0w%40mail.gmail.com.
--
Dan Villiom Podlaski Christiansen
dan...@gmail.com





Chuck Tuffli

未讀,
2021年8月6日 下午3:16:562021/8/6
收件者:hg-git
On Fri, Aug 6, 2021 at 10:58 AM Dan Villiom Podlaski Christiansen
<dan...@gmail.com> wrote:
>
> Before I try to debug this, I wanted to ask a question: Did you try following the advice, and do an 'hg pull'? If not, could you explain why? Perhaps the message is unhelpful or misleading?

Eeks. Apologies if it sounded like it was a problem with the tools.
No, hg-git is working fine. I'm the one that messed up. The hope was
that perhaps someone else on the list had worked through an issue like
this.

But yes, I did an hg pull which created two heads. The question was
more around if it is possible to combine the two histories and
slightly reorder them to reflect what I should have done in the first
place. The earlier advice about deleting the offending commits on
github is probably the easiest fix here.

--chuck

Alexander Leschinsky

未讀,
2021年12月26日 晚上7:23:472021/12/26
收件者:hg-git
On Saturday, August 7, 2021 at 12:16:56 AM UTC+5 ctu...@gmail.com wrote:
The question was more around if it is possible to combine the two histories and
slightly reorder them to reflect what I should have done in the first
place.

Why not?! In your local (2-heads) Mercurial-tree you can always
1. (easy dirty way) Rebase + Strip any subtrees as you want, but:
* You'll get all moved subtrees on old locations after first pull from remote HG-repo and must to polish repo one more time
2. (hack-ish longer, but smarter way) Install, grok, use evolve extension, eliminating the step of re-polishing pulled repo
  
回覆所有人
回覆作者
轉寄
0 則新訊息