Skip to content

Instantly share code, notes, and snippets.

@mithrandi
Created July 12, 2016 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mithrandi/a71bffcdc4e42496e39a6a659aa1fe7f to your computer and use it in GitHub Desktop.
Save mithrandi/a71bffcdc4e42496e39a6a659aa1fe7f to your computer and use it in GitHub Desktop.
Script to merge hg shamaps
import sys
revmap2 = {}
with open(sys.argv[2]) as fMap2:
for line in fMap2:
a, b = line.rstrip('\n').split(' ')
revmap2[a] = b
with open(sys.argv[1]) as fMap1:
for line in fMap1:
a, b = line.rstrip('\n').split(' ')
print '%s %s' % (a, revmap2[b])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment