comparison mercurial/commands.py @ 5936:00dfc810dae4

Add --no-commit option to import command
author Joel Rosdahl <joel@rosdahl.net>
date Fri, 25 Jan 2008 13:48:35 +0100
parents e7ed5d07cc4c
children e7f1be4bf40a
comparison
equal deleted inserted replaced
5933:28a79c259fcf 5936:00dfc810dae4
1526 try: 1526 try:
1527 fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root, 1527 fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root,
1528 files=files) 1528 files=files)
1529 finally: 1529 finally:
1530 files = patch.updatedir(ui, repo, files) 1530 files = patch.updatedir(ui, repo, files)
1531 n = repo.commit(files, message, user, date) 1531 if not opts.get('no_commit'):
1532 if opts.get('exact'): 1532 n = repo.commit(files, message, user, date)
1533 if hex(n) != nodeid: 1533 if opts.get('exact'):
1534 repo.rollback() 1534 if hex(n) != nodeid:
1535 raise util.Abort(_('patch is damaged' 1535 repo.rollback()
1536 ' or loses information')) 1536 raise util.Abort(_('patch is damaged'
1537 ' or loses information'))
1537 finally: 1538 finally:
1538 os.unlink(tmpname) 1539 os.unlink(tmpname)
1539 finally: 1540 finally:
1540 del lock, wlock 1541 del lock, wlock
1541 1542
2894 _('directory strip option for patch. This has the same\n' 2895 _('directory strip option for patch. This has the same\n'
2895 'meaning as the corresponding patch option')), 2896 'meaning as the corresponding patch option')),
2896 ('b', 'base', '', _('base path')), 2897 ('b', 'base', '', _('base path')),
2897 ('f', 'force', None, 2898 ('f', 'force', None,
2898 _('skip check for outstanding uncommitted changes')), 2899 _('skip check for outstanding uncommitted changes')),
2900 ('', 'no-commit', None, _("don't commit, just update the working directory")),
2899 ('', 'exact', None, 2901 ('', 'exact', None,
2900 _('apply patch to the nodes from which it was generated')), 2902 _('apply patch to the nodes from which it was generated')),
2901 ('', 'import-branch', None, 2903 ('', 'import-branch', None,
2902 _('Use any branch information in patch (implied by --exact)'))] + commitopts, 2904 _('Use any branch information in patch (implied by --exact)'))] + commitopts,
2903 _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')), 2905 _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')),