Skip to content

Instantly share code, notes, and snippets.

@jarosite
Created October 24, 2014 07:50
Show Gist options
  • Save jarosite/d2729a19e718edbfaad6 to your computer and use it in GitHub Desktop.
Save jarosite/d2729a19e718edbfaad6 to your computer and use it in GitHub Desktop.
If you get 400 on pull from mercurial, while push is working, probably you have a lot of closed branches but not merged anywhere. Create trash branch, and run this script.
for /F %%x in ('hg log -r "heads(all()) and closed()" --template "{rev}"\n') do (call :merge "%%x")
GOTO :eof
:merge
hg --config ui.merge=internal:local -y merge --rev %1
hg commit -m merge
GOTO :eof
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment