comparison mercurial/commands.py @ 14283:035489c9ea53

debugbuilddag: read DAG from stdin if not given on cmdline
author Martin Geisler <mg@aragost.com>
date Mon, 09 May 2011 18:11:08 +0200
parents b039b667515d
children 1f9e11f65cd7
comparison
equal deleted inserted replaced
14282:10286a04fbd9 14283:035489c9ea53
966 else: 966 else:
967 raise util.Abort(_('either two or three arguments required')) 967 raise util.Abort(_('either two or three arguments required'))
968 a = r.ancestor(lookup(rev1), lookup(rev2)) 968 a = r.ancestor(lookup(rev1), lookup(rev2))
969 ui.write("%d:%s\n" % (r.rev(a), hex(a))) 969 ui.write("%d:%s\n" % (r.rev(a), hex(a)))
970 970
971 def debugbuilddag(ui, repo, text, 971 def debugbuilddag(ui, repo, text=None,
972 mergeable_file=False, 972 mergeable_file=False,
973 overwritten_file=False, 973 overwritten_file=False,
974 new_file=False): 974 new_file=False):
975 """builds a repo with a given dag from scratch in the current empty repo 975 """builds a repo with a given DAG from scratch in the current empty repo
976
977 The description of the DAG is read from stdin if not given on the
978 command line.
976 979
977 Elements: 980 Elements:
978 981
979 - "+n" is a linear run of n nodes based on the current default parent 982 - "+n" is a linear run of n nodes based on the current default parent
980 - "." is a single node based on the current default parent 983 - "." is a single node based on the current default parent
998 - empty to denote the default parent. 1001 - empty to denote the default parent.
999 1002
1000 All string valued-elements are either strictly alphanumeric, or must 1003 All string valued-elements are either strictly alphanumeric, or must
1001 be enclosed in double quotes ("..."), with "\\" as escape character. 1004 be enclosed in double quotes ("..."), with "\\" as escape character.
1002 """ 1005 """
1006
1007 if text is None:
1008 ui.status(_("reading DAG from stdin\n"))
1009 text = sys.stdin.read()
1003 1010
1004 cl = repo.changelog 1011 cl = repo.changelog
1005 if len(cl) > 0: 1012 if len(cl) > 0:
1006 raise util.Abort(_('repository is not empty')) 1013 raise util.Abort(_('repository is not empty'))
1007 1014
4564 (debugbuilddag, 4571 (debugbuilddag,
4565 [('m', 'mergeable-file', None, _('add single file mergeable changes')), 4572 [('m', 'mergeable-file', None, _('add single file mergeable changes')),
4566 ('o', 'overwritten-file', None, _('add single file all revs overwrite')), 4573 ('o', 'overwritten-file', None, _('add single file all revs overwrite')),
4567 ('n', 'new-file', None, _('add new file at each rev')), 4574 ('n', 'new-file', None, _('add new file at each rev')),
4568 ], 4575 ],
4569 _('[OPTION]... TEXT')), 4576 _('[OPTION]... [TEXT]')),
4570 "debugbundle": 4577 "debugbundle":
4571 (debugbundle, 4578 (debugbundle,
4572 [('a', 'all', None, _('show all details')), 4579 [('a', 'all', None, _('show all details')),
4573 ], 4580 ],
4574 _('FILE')), 4581 _('FILE')),