Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 289:266396e32006
hg commit: add -t and -l options
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hg commit: add -t and -l options
This lets you specify commit text on the command line or point to a
file containing it.
manifest hash: 38201933edb1a89a5c3e0054d1b733cc4af46880
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCp40yywK+sNU5EO8RAgirAJ9ZAkfN+RyhPQGJBXKz3f7cR2xC0gCgo5l2
I9LQHVXT22rPb4tYUVq/bgQ=
=pA04
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Wed, 08 Jun 2005 16:28:34 -0800 |
parents | bd9d1e93f8d6 |
children | 07c6cb9fd1c5 |
comparison
equal
deleted
inserted
replaced
288:97c87ac6d7a4 | 289:266396e32006 |
---|---|
163 r = repo.file(relpath(repo, [file])[0]) | 163 r = repo.file(relpath(repo, [file])[0]) |
164 n = r.tip() | 164 n = r.tip() |
165 if rev: n = r.lookup(rev) | 165 if rev: n = r.lookup(rev) |
166 sys.stdout.write(r.read(n)) | 166 sys.stdout.write(r.read(n)) |
167 | 167 |
168 def commit(ui, repo, *files): | 168 def commit(ui, repo, *files, **opts): |
169 """commit the specified files or all outstanding changes""" | 169 """commit the specified files or all outstanding changes""" |
170 repo.commit(relpath(repo, files)) | 170 text = opts['text'] |
171 if not text and opts['logfile']: | |
172 try: text = open(opts['logfile']).read() | |
173 except IOError: pass | |
174 | |
175 repo.commit(relpath(repo, files), text) | |
171 | 176 |
172 def debugaddchangegroup(ui, repo): | 177 def debugaddchangegroup(ui, repo): |
173 data = sys.stdin.read() | 178 data = sys.stdin.read() |
174 repo.addchangegroup(data) | 179 repo.addchangegroup(data) |
175 | 180 |
479 ('n', 'number', None, 'show revision number'), | 484 ('n', 'number', None, 'show revision number'), |
480 ('c', 'changeset', None, 'show changeset')], | 485 ('c', 'changeset', None, 'show changeset')], |
481 'hg annotate [-u] [-c] [-n] [-r id] [files]'), | 486 'hg annotate [-u] [-c] [-n] [-r id] [files]'), |
482 "branch|clone": (branch, [], 'hg branch [path]'), | 487 "branch|clone": (branch, [], 'hg branch [path]'), |
483 "cat|dump": (cat, [], 'hg cat <file> [rev]'), | 488 "cat|dump": (cat, [], 'hg cat <file> [rev]'), |
484 "commit|ci": (commit, [], 'hg commit [files]'), | 489 "commit|ci": (commit, |
490 [('t', 'text', "", 'commit text'), | |
491 ('l', 'logfile', "", 'commit text file')], | |
492 'hg commit [files]'), | |
485 "debugaddchangegroup": (debugaddchangegroup, [], 'debugaddchangegroup'), | 493 "debugaddchangegroup": (debugaddchangegroup, [], 'debugaddchangegroup'), |
486 "debugchangegroup": (debugchangegroup, [], 'debugchangegroup [roots]'), | 494 "debugchangegroup": (debugchangegroup, [], 'debugchangegroup [roots]'), |
487 "debugindex": (debugindex, [], 'debugindex <file>'), | 495 "debugindex": (debugindex, [], 'debugindex <file>'), |
488 "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'), | 496 "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'), |
489 "diff": (diff, [('r', 'rev', [], 'revision')], | 497 "diff": (diff, [('r', 'rev', [], 'revision')], |