schacon / hg-git

mercurial to git bridge, pushed to directly from the hg-git plugin in Hg
GNU General Public License v2.0
621 stars 71 forks source link

Unable to push after rebase: unknown revision X #298

Open elifarley opened 9 years ago

elifarley commented 9 years ago

% hg push --rev . --force git+https://github.com/elifarley/orgecc-libcalltimer.git pushing to git+https://github.com/elifarley/orgecc-libcalltimer.git http authorization required for https://github.com/elifarley/orgecc-libcalltimer.git/info/refs realm: GitHub user: elifarley searching for changes unknown revision 'b8b60eadca08f713e79f4e5440b738bf3acf12d5'

ghost commented 8 years ago

I've got the same error when i'm trying to emulate my developing workflow. Just do the follow steps:

  1. Create git repository and create some git branch. (git init && git create -b mybranch)
  2. Clone git repository into mercurial repo. (hg clone git+ssh://...../repo myrepo)
  3. Switch to bookmark mybranch(git branch) and add some commits. (hg up mybranch && hg ci -m 'some changes')
  4. Rebase commits
  5. Try to push changes.

Actual result:

% hg push -v
pushing to /home/Temp/test/GIT_repo
searching for changes
abort: unknown revision 'c1e69fbcb5152c50836b491f34f19025e32af87e'!

Additional info: Mercurial Distributed SCM (version 3.7.3) dulwich - 0.12.0 (latest) hg-git 0.8.5

ghost commented 8 years ago

A Problem can be solved by follow command: hg rebase -b --keepbranch

or add in .hgrc [default] rebase= --keepbranch