Skip to content

Instantly share code, notes, and snippets.

@haard
Created January 26, 2014 21:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save haard/8639666 to your computer and use it in GitHub Desktop.
Save haard/8639666 to your computer and use it in GitHub Desktop.
Use hggit and hgapi to push a hg repo to a git mirror
branch_mapping = [('default', 'master')]
target = "git+ssh://git@github.com/haard/test"
repo = hgapi.Repo(path)
for hgb, gb in branch_mapping:
repo.hg_command('bookmark', '-r', hgb, gb)
repo.hg_command("--config", "paths.default=" + target, "--config", "extensions.hggit=", "push")
@haard
Copy link
Author

haard commented Jan 26, 2014

This is the 'same' code as BitSyncHub uses

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment