455 else: |
455 else: |
456 r = os.system(cmd) |
456 r = os.system(cmd) |
457 os.kill(child, signal.SIGTERM) |
457 os.kill(child, signal.SIGTERM) |
458 return r |
458 return r |
459 |
459 |
460 def rawcommit(ui, repo, files, **rc): |
460 def rawcommit(ui, repo, flist, **rc): |
461 "raw commit interface" |
461 "raw commit interface" |
462 |
462 |
463 text = rc['text'] |
463 text = rc['text'] |
464 if not text and rc['logfile']: |
464 if not text and rc['logfile']: |
465 try: text = open(rc['logfile']).read() |
465 try: text = open(rc['logfile']).read() |
466 except IOError: pass |
466 except IOError: pass |
467 if not text and not rc['logfile']: |
467 if not text and not rc['logfile']: |
468 print "missing commit text" |
468 print "missing commit text" |
469 return 1 |
469 return 1 |
470 |
470 |
471 files = relpath(repo, files) |
471 files = relpath(repo, flist) |
472 if rc['files']: |
472 if rc['files']: |
473 files += open(rc['files']).read().splitlines() |
473 files += open(rc['files']).read().splitlines() |
474 |
474 |
475 repo.rawcommit(files, text, rc['user'], rc['date'], *rc['parent']) |
475 repo.rawcommit(files, text, rc['user'], rc['date'], *rc['parent']) |
476 |
476 |