1703 Lowlevel commit, for use in helper scripts. |
1703 Lowlevel commit, for use in helper scripts. |
1704 |
1704 |
1705 This command is not intended to be used by normal users, as it is |
1705 This command is not intended to be used by normal users, as it is |
1706 primarily useful for importing from other SCMs. |
1706 primarily useful for importing from other SCMs. |
1707 """ |
1707 """ |
1708 if rc['text']: |
1708 message = rc['message'] |
1709 ui.warn(_("Warning: -t and --text is deprecated," |
|
1710 " please use -m or --message instead.\n")) |
|
1711 message = rc['message'] or rc['text'] |
|
1712 if not message and rc['logfile']: |
1709 if not message and rc['logfile']: |
1713 try: |
1710 try: |
1714 message = open(rc['logfile']).read() |
1711 message = open(rc['logfile']).read() |
1715 except IOError: |
1712 except IOError: |
1716 pass |
1713 pass |
1978 To facilitate version control, distribution, and merging of tags, |
1975 To facilitate version control, distribution, and merging of tags, |
1979 they are stored as a file named ".hgtags" which is managed |
1976 they are stored as a file named ".hgtags" which is managed |
1980 similarly to other project files and can be hand-edited if |
1977 similarly to other project files and can be hand-edited if |
1981 necessary. |
1978 necessary. |
1982 """ |
1979 """ |
1983 if opts['text']: |
|
1984 ui.warn(_("Warning: -t and --text is deprecated," |
|
1985 " please use -m or --message instead.\n")) |
|
1986 if name == "tip": |
1980 if name == "tip": |
1987 raise util.Abort(_("the name 'tip' is reserved")) |
1981 raise util.Abort(_("the name 'tip' is reserved")) |
1988 if rev: |
1982 if rev: |
1989 r = hex(repo.lookup(rev)) |
1983 r = hex(repo.lookup(rev)) |
1990 else: |
1984 else: |
2005 |
1999 |
2006 repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name)) |
2000 repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name)) |
2007 if repo.dirstate.state(".hgtags") == '?': |
2001 if repo.dirstate.state(".hgtags") == '?': |
2008 repo.add([".hgtags"]) |
2002 repo.add([".hgtags"]) |
2009 |
2003 |
2010 message = (opts['message'] or opts['text'] or |
2004 message = (opts['message'] or |
2011 _("Added tag %s for changeset %s") % (name, r)) |
2005 _("Added tag %s for changeset %s") % (name, r)) |
2012 try: |
2006 try: |
2013 repo.commit([".hgtags"], message, opts['user'], opts['date']) |
2007 repo.commit([".hgtags"], message, opts['user'], opts['date']) |
2014 except ValueError, inst: |
2008 except ValueError, inst: |
2015 raise util.Abort(str(inst)) |
2009 raise util.Abort(str(inst)) |
2289 [('p', 'parent', [], _('parent')), |
2283 [('p', 'parent', [], _('parent')), |
2290 ('d', 'date', "", _('date code')), |
2284 ('d', 'date', "", _('date code')), |
2291 ('u', 'user', "", _('user')), |
2285 ('u', 'user', "", _('user')), |
2292 ('F', 'files', "", _('file list')), |
2286 ('F', 'files', "", _('file list')), |
2293 ('m', 'message', "", _('commit message')), |
2287 ('m', 'message', "", _('commit message')), |
2294 ('t', 'text', "", _('commit message (deprecated: use -m)')), |
|
2295 ('l', 'logfile', "", _('commit message file'))], |
2288 ('l', 'logfile', "", _('commit message file'))], |
2296 _('hg rawcommit [OPTION]... [FILE]...')), |
2289 _('hg rawcommit [OPTION]... [FILE]...')), |
2297 "recover": (recover, [], _("hg recover")), |
2290 "recover": (recover, [], _("hg recover")), |
2298 "^remove|rm": (remove, |
2291 "^remove|rm": (remove, |
2299 [('I', 'include', [], _('include names matching the given patterns')), |
2292 [('I', 'include', [], _('include names matching the given patterns')), |
2337 _("hg status [OPTION]... [FILE]...")), |
2330 _("hg status [OPTION]... [FILE]...")), |
2338 "tag": |
2331 "tag": |
2339 (tag, |
2332 (tag, |
2340 [('l', 'local', None, _('make the tag local')), |
2333 [('l', 'local', None, _('make the tag local')), |
2341 ('m', 'message', "", _('message for tag commit log entry')), |
2334 ('m', 'message', "", _('message for tag commit log entry')), |
2342 ('t', 'text', "", _('commit message (deprecated: use -m)')), |
|
2343 ('d', 'date', "", _('record datecode as commit date')), |
2335 ('d', 'date', "", _('record datecode as commit date')), |
2344 ('u', 'user', "", _('record user as commiter'))], |
2336 ('u', 'user', "", _('record user as commiter'))], |
2345 _('hg tag [OPTION]... NAME [REV]')), |
2337 _('hg tag [OPTION]... NAME [REV]')), |
2346 "tags": (tags, [], _('hg tags')), |
2338 "tags": (tags, [], _('hg tags')), |
2347 "tip": (tip, [], _('hg tip')), |
2339 "tip": (tip, [], _('hg tip')), |