Show More
@@ -65,9 +65,10 b" def fetch(ui, repo, source='default', **" | |||||
65 | message = (cmdutil.logmessage(opts) or |
|
65 | message = (cmdutil.logmessage(opts) or | |
66 | (_('Automated merge with %s') % |
|
66 | (_('Automated merge with %s') % | |
67 | util.removeauth(other.url()))) |
|
67 | util.removeauth(other.url()))) | |
|
68 | force_editor = opts.get('force_editor') or opts.get('edit') | |||
68 | n = repo.commit(mod + add + rem, message, |
|
69 | n = repo.commit(mod + add + rem, message, | |
69 | opts['user'], opts['date'], |
|
70 | opts['user'], opts['date'], | |
70 |
force_editor= |
|
71 | force_editor=force_editor) | |
71 | ui.status(_('new changeset %d:%s merges remote changes ' |
|
72 | ui.status(_('new changeset %d:%s merges remote changes ' | |
72 | 'with local\n') % (repo.changelog.rev(n), |
|
73 | 'with local\n') % (repo.changelog.rev(n), | |
73 | short(n))) |
|
74 | short(n))) | |
@@ -102,9 +103,11 b" def fetch(ui, repo, source='default', **" | |||||
102 | try: |
|
103 | try: | |
103 | wlock = repo.wlock() |
|
104 | wlock = repo.wlock() | |
104 | lock = repo.lock() |
|
105 | lock = repo.lock() | |
105 |
mod, add, rem = repo.status()[: |
|
106 | mod, add, rem, del_ = repo.status()[:4] | |
106 | if mod or add or rem: |
|
107 | if mod or add or rem: | |
107 | raise util.Abort(_('outstanding uncommitted changes')) |
|
108 | raise util.Abort(_('outstanding uncommitted changes')) | |
|
109 | if del_: | |||
|
110 | raise util.Abort(_('working directory is missing some files')) | |||
108 | if len(repo.heads()) > 1: |
|
111 | if len(repo.heads()) > 1: | |
109 | raise util.Abort(_('multiple heads in this repository ' |
|
112 | raise util.Abort(_('multiple heads in this repository ' | |
110 | '(use "hg heads" and "hg merge" to merge)')) |
|
113 | '(use "hg heads" and "hg merge" to merge)')) | |
@@ -116,7 +119,8 b' cmdtable = {' | |||||
116 | 'fetch': |
|
119 | 'fetch': | |
117 | (fetch, |
|
120 | (fetch, | |
118 | [('r', 'rev', [], _('a specific revision you would like to pull')), |
|
121 | [('r', 'rev', [], _('a specific revision you would like to pull')), | |
119 |
(' |
|
122 | ('e', 'edit', None, _('edit commit message')), | |
|
123 | ('', 'force-editor', None, _('edit commit message (DEPRECATED)')), | |||
120 | ('', 'switch-parent', None, _('switch parents when merging')), |
|
124 | ('', 'switch-parent', None, _('switch parents when merging')), | |
121 | ] + commands.commitopts + commands.commitopts2 + commands.remoteopts, |
|
125 | ] + commands.commitopts + commands.commitopts2 + commands.remoteopts, | |
122 | _('hg fetch [SOURCE]')), |
|
126 | _('hg fetch [SOURCE]')), |
@@ -52,5 +52,12 b" hg --cwd f ci -d '6 0' -Amf" | |||||
52 | echo g > g/g |
|
52 | echo g > g/g | |
53 | hg --cwd g ci -d '6 0' -Amg |
|
53 | hg --cwd g ci -d '6 0' -Amg | |
54 |
|
54 | |||
|
55 | hg clone -q f h | |||
|
56 | hg clone -q g i | |||
|
57 | ||||
55 | echo % should merge f into g |
|
58 | echo % should merge f into g | |
56 | hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f |
|
59 | hg --cwd g fetch -d '7 0' --switch -m 'automated merge' ../f | |
|
60 | ||||
|
61 | rm i/g | |||
|
62 | echo % should abort, because i is modified | |||
|
63 | hg --cwd i fetch ../h |
@@ -71,3 +71,5 b' 0 files updated, 0 files merged, 0 files' | |||||
71 | merging with 3:cc6a3744834d |
|
71 | merging with 3:cc6a3744834d | |
72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
72 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
73 | new changeset 4:55aa4f32ec59 merges remote changes with local |
|
73 | new changeset 4:55aa4f32ec59 merges remote changes with local | |
|
74 | % should abort, because i is modified | |||
|
75 | abort: working directory is missing some files |
General Comments 0
You need to be logged in to leave comments.
Login now