# HG changeset patch # User Matt Mackall # Date 1205275346 18000 # Node ID 4c1aa6affe6099f8dcb912588ef589abe4bfafc3 # Parent 210ee6204a295d21bf444d98dc92cf7e23973c71# Parent bd61e44eb2ccbadd5f64e27900c8c1861077c0c4 Merge with crew diff -r 210ee6204a29 -r 4c1aa6affe60 hgext/fetch.py --- a/hgext/fetch.py Mon Mar 10 02:54:37 2008 -0500 +++ b/hgext/fetch.py Tue Mar 11 17:42:26 2008 -0500 @@ -65,9 +65,10 @@ message = (cmdutil.logmessage(opts) or (_('Automated merge with %s') % util.removeauth(other.url()))) + force_editor = opts.get('force_editor') or opts.get('edit') n = repo.commit(mod + add + rem, message, opts['user'], opts['date'], - force_editor=opts.get('force_editor')) + force_editor=force_editor) ui.status(_('new changeset %d:%s merges remote changes ' 'with local\n') % (repo.changelog.rev(n), short(n))) @@ -102,9 +103,11 @@ try: wlock = repo.wlock() lock = repo.lock() - mod, add, rem = repo.status()[:3] + mod, add, rem, del_ = repo.status()[:4] if mod or add or rem: raise util.Abort(_('outstanding uncommitted changes')) + if del_: + raise util.Abort(_('working directory is missing some files')) if len(repo.heads()) > 1: raise util.Abort(_('multiple heads in this repository ' '(use "hg heads" and "hg merge" to merge)')) @@ -116,7 +119,8 @@ 'fetch': (fetch, [('r', 'rev', [], _('a specific revision you would like to pull')), - ('f', 'force-editor', None, _('edit commit message')), + ('e', 'edit', None, _('edit commit message')), + ('', 'force-editor', None, _('edit commit message (DEPRECATED)')), ('', 'switch-parent', None, _('switch parents when merging')), ] + commands.commitopts + commands.commitopts2 + commands.remoteopts, _('hg fetch [SOURCE]')), diff -r 210ee6204a29 -r 4c1aa6affe60 tests/test-fetch --- a/tests/test-fetch Mon Mar 10 02:54:37 2008 -0500 +++ b/tests/test-fetch Tue Mar 11 17:42:26 2008 -0500 @@ -52,5 +52,12 @@ echo g > g/g hg --cwd g ci -d '6 0' -Amg +hg clone -q f h +hg clone -q g i + echo % should merge f into g hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f + +rm i/g +echo % should abort, because i is modified +hg --cwd i fetch ../h diff -r 210ee6204a29 -r 4c1aa6affe60 tests/test-fetch.out --- a/tests/test-fetch.out Mon Mar 10 02:54:37 2008 -0500 +++ b/tests/test-fetch.out Tue Mar 11 17:42:26 2008 -0500 @@ -71,3 +71,5 @@ merging with 3:cc6a3744834d 1 files updated, 0 files merged, 0 files removed, 0 files unresolved new changeset 4:55aa4f32ec59 merges remote changes with local +% should abort, because i is modified +abort: working directory is missing some files