# HG changeset patch # User Martin Geisler # Date 1304957468 -7200 # Node ID 035489c9ea53c10c70f46286266517a293954ea5 # Parent 10286a04fbd92b6780cd144409525172e501a108 debugbuilddag: read DAG from stdin if not given on cmdline diff -r 10286a04fbd9 -r 035489c9ea53 mercurial/commands.py --- a/mercurial/commands.py Mon May 09 17:20:15 2011 +0200 +++ b/mercurial/commands.py Mon May 09 18:11:08 2011 +0200 @@ -968,11 +968,14 @@ a = r.ancestor(lookup(rev1), lookup(rev2)) ui.write("%d:%s\n" % (r.rev(a), hex(a))) -def debugbuilddag(ui, repo, text, +def debugbuilddag(ui, repo, text=None, mergeable_file=False, overwritten_file=False, new_file=False): - """builds a repo with a given dag from scratch in the current empty repo + """builds a repo with a given DAG from scratch in the current empty repo + + The description of the DAG is read from stdin if not given on the + command line. Elements: @@ -1001,6 +1004,10 @@ be enclosed in double quotes ("..."), with "\\" as escape character. """ + if text is None: + ui.status(_("reading DAG from stdin\n")) + text = sys.stdin.read() + cl = repo.changelog if len(cl) > 0: raise util.Abort(_('repository is not empty')) @@ -4566,7 +4573,7 @@ ('o', 'overwritten-file', None, _('add single file all revs overwrite')), ('n', 'new-file', None, _('add new file at each rev')), ], - _('[OPTION]... TEXT')), + _('[OPTION]... [TEXT]')), "debugbundle": (debugbundle, [('a', 'all', None, _('show all details')),