[Python-checkins] pymigr: Handle splitting/merging by writing a shell script.
local
python-checkins at python.org
Wed Nov 24 10:24:08 CET 2010
local pushed 2c3dde99e94e to pymigr:
http://hg.python.org/pymigr/rev/2c3dde99e94e
changeset: 71:2c3dde99e94e
parent: 63:c579d2310379
user: Dirkjan Ochtman <dirkjan at ochtman.nl>
date: Wed Nov 24 10:23:22 2010 +0100
summary:
Handle splitting/merging by writing a shell script.
files:
split.py
diff --git a/split.py b/split.py
--- a/split.py
+++ b/split.py
@@ -1,7 +1,16 @@
from mercurial import ui, hg
+def rtags():
+ tags = {}
+ for ln in open('tagmap.txt'):
+ src, dst = ln.strip().split('=')
+ if dst.strip():
+ tags[src.strip()] = dst.strip()
+ return tags
+
def find(repo):
+ want = rtags()
main = set()
for n in repo.heads():
@@ -14,21 +23,34 @@
tags.remove('tip')
if '/tags/' in path and not tags:
- print 'missing tags', path
+ continue
elif '/tags/' not in path and tags:
- print 'unexpected tags', tags
+ continue
+ #print 'unexpected tags', tags
if path.endswith('-maint'):
continue
name = path.split('/')[-1]
if not tags and name not in set(('py3k', 'p3yk', 'trunk')):
- print 'clone', path, '->', path.split('/')[-1]
+ #print 'clone', path, '->', path.split('/')[-1]
+ continue
+
+ if path == 'python/trunk':
+ print 'hg pull -r%s ../python-hg' % ctx
+ elif path == 'python/branches/py3k':
+ print 'hg pull -r%s ../python-hg' % ctx
+ elif path == 'python/branches/p3yk':
+ print 'hg pull -r%s ../python-hg' % ctx
+ print 'hg up -C %s' % ctx.branch()
+ print 'hg parents'
+ print 'hg merge %s' % ctx
+ print '''hg ci -m "Close branch for tag '%s'."''' % name
else:
- main.add(ctx.hex())
-
- print main
-
+ print 'hg pull -r%s ../python-hg' % ctx
+ print 'hg up -C %s' % ctx.branch()
+ print 'hg merge --tool internal:local %s' % ctx
+ print '''hg ci -m "Close branch for tag '%s'."''' % name
if __name__ == '__main__':
repo = hg.repository(ui.ui(), 'python-hg')
--
Repository URL: http://hg.python.org/pymigr
More information about the Python-checkins
mailing list