##// END OF EJS Templates
refactor rawcommit
Matt Mackall -
r3653:d793e09e default
parent child Browse files
Show More
@@ -1778,7 +1778,7 b' def push(ui, repo, dest=None, **opts):'
1778 r = repo.push(other, opts['force'], revs=revs)
1778 r = repo.push(other, opts['force'], revs=revs)
1779 return r == 0
1779 return r == 0
1780
1780
1781 def rawcommit(ui, repo, *flist, **rc):
1781 def rawcommit(ui, repo, *pats, **opts):
1782 """raw commit interface (DEPRECATED)
1782 """raw commit interface (DEPRECATED)
1783
1783
1784 (DEPRECATED)
1784 (DEPRECATED)
@@ -1793,23 +1793,17 b' def rawcommit(ui, repo, *flist, **rc):'
1793
1793
1794 ui.warn(_("(the rawcommit command is deprecated)\n"))
1794 ui.warn(_("(the rawcommit command is deprecated)\n"))
1795
1795
1796 message = rc['message']
1796 message = logmessage(opts)
1797 if not message and rc['logfile']:
1797
1798 try:
1798 files, match, anypats = cmdutil.matchpats(repo, pats, opts)
1799 message = open(rc['logfile']).read()
1799 if opts['files']:
1800 except IOError:
1800 files += open(opts['files']).read().splitlines()
1801 pass
1801
1802 if not message and not rc['logfile']:
1802 parents = [repo.lookup(p) for p in opts['parent']]
1803 raise util.Abort(_("missing commit message"))
1804
1805 files = relpath(repo, list(flist))
1806 if rc['files']:
1807 files += open(rc['files']).read().splitlines()
1808
1809 rc['parent'] = map(repo.lookup, rc['parent'])
1810
1803
1811 try:
1804 try:
1812 repo.rawcommit(files, message, rc['user'], rc['date'], *rc['parent'])
1805 repo.rawcommit(files, message,
1806 opts['user'], opts['date'], *parents)
1813 except ValueError, inst:
1807 except ValueError, inst:
1814 raise util.Abort(str(inst))
1808 raise util.Abort(str(inst))
1815
1809
General Comments 0
You need to be logged in to leave comments. Login now