comparison hg @ 203:0b486b5e0796

hg rawcommit command -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 hg rawcommit command From: Christopher Li <hg@chrisli.org> This allows direct access to the commit command, primarily for importing from other SCMs. manifest hash: bea39fa8207582c9fa7ba0904721eb5113c61cf4 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCnUinywK+sNU5EO8RAhWqAJ9PiafRbfEIA3VsO07BbGZr5adNvgCfT2k7 blYTdkrIiRzzCxn6yPq8Yu4= =o8k0 -----END PGP SIGNATURE-----
author mpm@selenic.com
date Tue, 31 May 2005 21:33:27 -0800
parents c88ef31fb5c0
children 3295b6b508de
comparison
equal deleted inserted replaced
202:e875a0cf7f3a 203:0b486b5e0796
148 if 1: 148 if 1:
149 if len(args) > 0: 149 if len(args) > 0:
150 repo.commit(repo.current, args) 150 repo.commit(repo.current, args)
151 else: 151 else:
152 repo.commit(repo.current) 152 repo.commit(repo.current)
153 153 elif cmd == "rawcommit":
154 "raw commit interface"
155 rc = {}
156 opts = [('p', 'parent', [], 'parent'),
157 ('d', 'date', "", 'data'),
158 ('u', 'user', "", 'user'),
159 ('F', 'files', "", 'file list'),
160 ('t', 'text', "", 'commit text'),
161 ('l', 'logfile', "", 'commit text file')
162 ]
163 args = fancyopts.fancyopts(args, opts, rc,
164 "hg rawcommit [options] files")
165 text = rc['text']
166 if not text and rc['logfile']:
167 try: text = open(rc['logfile']).read()
168 except IOError: pass
169 if not text and not rc['logfile']:
170 print "missing commit text"
171 sys.exit(0)
172 if rc['files']:
173 files = open(rc['files']).read().splitlines()
174 else:
175 files = args
176
177 repo.rawcommit(files, text, rc['user'], rc['date'], *rc['parent'])
178
179
154 elif cmd == "import" or cmd == "patch": 180 elif cmd == "import" or cmd == "patch":
155 try: 181 try:
156 import psyco 182 import psyco
157 psyco.full() 183 psyco.full()
158 except: 184 except: