Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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