Merge lp:~gz/bzr/resolve_all_deprecation into lp:bzr

Proposed by Martin Packman
Status: Needs review
Proposed branch: lp:~gz/bzr/resolve_all_deprecation
Merge into: lp:bzr
Prerequisite: lp:~gz/bzr/resolve_auto_refactor
Diff against target: 175 lines (+36/-13)
8 files modified
bzrlib/conflicts.py (+10/-6)
bzrlib/tests/blackbox/test_remerge.py (+1/-1)
bzrlib/tests/blackbox/test_resolve.py (+19/-0)
bzrlib/tests/blackbox/test_too_much.py (+2/-2)
doc/en/tutorials/centralized_workflow.txt (+1/-1)
doc/ja/tutorials/centralized_workflow.txt (+1/-1)
doc/ja/user-reference/index.txt (+1/-1)
doc/ru/tutorials/centralized_workflow.txt (+1/-1)
To merge this branch: bzr merge lp:~gz/bzr/resolve_all_deprecation
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+117071@code.launchpad.net

Description of the change

Deprecate `bzr resolve --all`, it's the same as `bzr resolve --done` but can't be used for a subset of files and may give users the false impression it does something more than just wipe the conflict list.

This is going to clash a fair bit with lp:~gz/bzr/resolve_file_not_done and the documentation probably wants more sensible updating for both.

To post a comment you must log in.

Unmerged revisions

6547. By Martin Packman

Update some documentation to not mention resolve --all

6546. By Martin Packman

Deprecate the use of resolve --all instead just use --done

6545. By Martin Packman

Deprecate WorkingTree.auto_resolve

6544. By Martin Packman

Refactor auto_resolve tree method into auto action on conflicts

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/conflicts.py'
--- bzrlib/conflicts.py 2012-07-27 14:48:18 +0000
+++ bzrlib/conflicts.py 2012-07-27 14:48:18 +0000
@@ -34,6 +34,7 @@
34 trace,34 trace,
35 transform,35 transform,
36 workingtree,36 workingtree,
37 ui,
37 )38 )
38from bzrlib.i18n import gettext, ngettext39from bzrlib.i18n import gettext, ngettext
39""")40""")
@@ -113,7 +114,7 @@
113114
114 Once you have fixed a problem, use "bzr resolve" to automatically mark115 Once you have fixed a problem, use "bzr resolve" to automatically mark
115 text conflicts as fixed, "bzr resolve FILE" to mark a specific conflict as116 text conflicts as fixed, "bzr resolve FILE" to mark a specific conflict as
116 resolved, or "bzr resolve --all" to mark all conflicts as resolved.117 resolved, or "bzr resolve --done" to mark all conflicts as resolved.
117 """118 """
118 aliases = ['resolved']119 aliases = ['resolved']
119 takes_args = ['file*']120 takes_args = ['file*']
@@ -125,22 +126,25 @@
125 _see_also = ['conflicts']126 _see_also = ['conflicts']
126 def run(self, file_list=None, all=False, action=None, directory=None):127 def run(self, file_list=None, all=False, action=None, directory=None):
127 if all:128 if all:
129 ui.ui_factory.show_user_warning(
130 'deprecated_command_option',
131 deprecated_name='--all',
132 recommended_name='bzr resolve --done',
133 deprecated_in_version='2.6',
134 command=self.invoked_as)
128 if file_list:135 if file_list:
129 raise errors.BzrCommandError(gettext("If --all is specified,"136 raise errors.BzrCommandError(gettext("If --all is specified,"
130 " no FILE may be provided"))137 " no FILE may be provided"))
131 if directory is None:
132 directory = u'.'
133 tree = workingtree.WorkingTree.open_containing(directory)[0]
134 if action is None:138 if action is None:
135 action = 'done'139 action = 'done'
136 else:140 else:
137 tree, file_list = workingtree.WorkingTree.open_containing_paths(
138 file_list, directory)
139 if action is None:141 if action is None:
140 if file_list is None:142 if file_list is None:
141 action = 'auto'143 action = 'auto'
142 else:144 else:
143 action = 'done'145 action = 'done'
146 tree, file_list = workingtree.WorkingTree.open_containing_paths(
147 file_list, directory)
144 before, after = resolve(tree, file_list, action=action)148 before, after = resolve(tree, file_list, action=action)
145 # GZ 2012-07-27: Should unify UI below now that auto is less magical.149 # GZ 2012-07-27: Should unify UI below now that auto is less magical.
146 if action == 'auto' and file_list is None:150 if action == 'auto' and file_list is None:
147151
=== modified file 'bzrlib/tests/blackbox/test_remerge.py'
--- bzrlib/tests/blackbox/test_remerge.py 2012-01-05 13:02:31 +0000
+++ bzrlib/tests/blackbox/test_remerge.py 2012-07-27 14:48:18 +0000
@@ -105,7 +105,7 @@
105 'remerge hello --reprocess',105 'remerge hello --reprocess',
106 retcode=1, working_dir='this')106 retcode=1, working_dir='this')
107107
108 self.run_bzr('resolve --all', working_dir='this')108 self.run_bzr('resolve --done', working_dir='this')
109 self.run_bzr('commit -m done', working_dir='this')109 self.run_bzr('commit -m done', working_dir='this')
110110
111 self.run_bzr_error(['remerge only works after normal merges',111 self.run_bzr_error(['remerge only works after normal merges',
112112
=== modified file 'bzrlib/tests/blackbox/test_resolve.py'
--- bzrlib/tests/blackbox/test_resolve.py 2011-09-16 15:37:58 +0000
+++ bzrlib/tests/blackbox/test_resolve.py 2012-07-27 14:48:18 +0000
@@ -47,6 +47,16 @@
47 self.run_script("""\47 self.run_script("""\
48$ cd branch48$ cd branch
49$ bzr resolve --all49$ bzr resolve --all
502>The option '--all' to 'bzr resolve' has been deprecated in bzr 2.6. \
51Please use 'bzr resolve --done' instead.
522>3 conflicts resolved, 0 remaining
53$ bzr conflicts
54""")
55
56 def test_resolve_done(self):
57 self.run_script("""\
58$ cd branch
59$ bzr resolve --done
502>3 conflicts resolved, 0 remaining602>3 conflicts resolved, 0 remaining
51$ bzr conflicts61$ bzr conflicts
52""")62""")
@@ -68,6 +78,15 @@
68 def test_resolve_all_via_directory_option(self):78 def test_resolve_all_via_directory_option(self):
69 self.run_script("""\79 self.run_script("""\
70$ bzr resolve -d branch --all80$ bzr resolve -d branch --all
812>The option '--all' to 'bzr resolve' has been deprecated in bzr 2.6. \
82Please use 'bzr resolve --done' instead.
832>3 conflicts resolved, 0 remaining
84$ bzr conflicts -d branch
85""")
86
87 def test_resolve_done_via_directory_option(self):
88 self.run_script("""\
89$ bzr resolve -d branch --done
712>3 conflicts resolved, 0 remaining902>3 conflicts resolved, 0 remaining
72$ bzr conflicts -d branch91$ bzr conflicts -d branch
73""")92""")
7493
=== modified file 'bzrlib/tests/blackbox/test_too_much.py'
--- bzrlib/tests/blackbox/test_too_much.py 2011-09-26 15:21:01 +0000
+++ bzrlib/tests/blackbox/test_too_much.py 2012-07-27 14:48:18 +0000
@@ -240,7 +240,7 @@
240 self.assert_('|||||||' in conflict_text)240 self.assert_('|||||||' in conflict_text)
241 self.assert_('hi world' in conflict_text)241 self.assert_('hi world' in conflict_text)
242 self.run_bzr('revert')242 self.run_bzr('revert')
243 self.run_bzr('resolve --all')243 self.run_bzr('resolve --done')
244 self.run_bzr('merge ../other', retcode=1)244 self.run_bzr('merge ../other', retcode=1)
245 conflict_text = file('hello').read()245 conflict_text = file('hello').read()
246 self.assert_('|||||||' not in conflict_text)246 self.assert_('|||||||' not in conflict_text)
@@ -255,7 +255,7 @@
255 result = self.run_bzr('conflicts')[0]255 result = self.run_bzr('conflicts')[0]
256 self.assertEquals(result, "Text conflict in question\n")256 self.assertEquals(result, "Text conflict in question\n")
257 self.run_bzr('commit -m conflicts', retcode=3)257 self.run_bzr('commit -m conflicts', retcode=3)
258 self.run_bzr('resolve --all')258 self.run_bzr('resolve --done')
259 result = self.run_bzr('conflicts')[0]259 result = self.run_bzr('conflicts')[0]
260 self.run_bzr('commit -m conflicts')260 self.run_bzr('commit -m conflicts')
261 self.assertEquals(result, "")261 self.assertEquals(result, "")
262262
=== modified file 'doc/en/tutorials/centralized_workflow.txt'
--- doc/en/tutorials/centralized_workflow.txt 2011-04-06 04:58:43 +0000
+++ doc/en/tutorials/centralized_workflow.txt 2012-07-27 14:48:18 +0000
@@ -256,7 +256,7 @@
256conflicts. That way you don't accidentally commit the conflict markers.256conflicts. That way you don't accidentally commit the conflict markers.
257The command ``bzr status`` will show the conflicts along with the other257The command ``bzr status`` will show the conflicts along with the other
258changes, or you can use ``bzr conflicts`` to just list conflicts. Use258changes, or you can use ``bzr conflicts`` to just list conflicts. Use
259``bzr resolve file/name`` or ``bzr resolve --all`` once conflicts have259``bzr resolve file/name`` or ``bzr resolve --done`` once conflicts have
260been handled. [#resolve]_ If you have a conflict that is particularly260been handled. [#resolve]_ If you have a conflict that is particularly
261difficult to solve you may want to use the ``bzr remerge`` command. It261difficult to solve you may want to use the ``bzr remerge`` command. It
262will let you try different merge algorithms, as well as let you see the262will let you try different merge algorithms, as well as let you see the
263263
=== modified file 'doc/ja/tutorials/centralized_workflow.txt'
--- doc/ja/tutorials/centralized_workflow.txt 2011-05-18 13:12:59 +0000
+++ doc/ja/tutorials/centralized_workflow.txt 2012-07-27 14:48:18 +0000
@@ -228,7 +228,7 @@
228そのため、間違って競合マーカーをコミットしてしまうことはありません。228そのため、間違って競合マーカーをコミットしてしまうことはありません。
229``bzr status`` コマンドを使えば、他の変更内容と一緒に競合の情報も表示されます。229``bzr status`` コマンドを使えば、他の変更内容と一緒に競合の情報も表示されます。
230``bzr conflicts`` なら、競合の情報だけが表示されます。230``bzr conflicts`` なら、競合の情報だけが表示されます。
231競合を解決し終わったら、``bzr resolve file/name`` か ``bzr resolve --all`` を実行してください。231競合を解決し終わったら、``bzr resolve file/name`` か ``bzr resolve --done`` を実行してください。
232[#resolve]_ もし、解決が特に難しい競合がある場合は、 ``bzr remerge`` コマンドを使いたいと思うかもしれません。232[#resolve]_ もし、解決が特に難しい競合がある場合は、 ``bzr remerge`` コマンドを使いたいと思うかもしれません。
233このコマンドで、別のマージアルゴリズムを試してみることができ、さらに元のソース行を表示する\233このコマンドで、別のマージアルゴリズムを試してみることができ、さらに元のソース行を表示する\
234こともできます。(``--show-base``)234こともできます。(``--show-base``)
235235
=== modified file 'doc/ja/user-reference/index.txt'
--- doc/ja/user-reference/index.txt 2011-05-18 06:01:08 +0000
+++ doc/ja/user-reference/index.txt 2012-07-27 14:48:18 +0000
@@ -3198,7 +3198,7 @@
3198 3198
3199 一旦問題を修正すれば、自動的にテキストの衝突を修正したものとしてマークするために"bzr resolve"を使用し、3199 一旦問題を修正すれば、自動的にテキストの衝突を修正したものとしてマークするために"bzr resolve"を使用し、
3200 特定の衝突を解消したものとしてマークするためにFILEをresolveします。3200 特定の衝突を解消したものとしてマークするためにFILEをresolveします。
3201 すべての衝突が解消されたものとしてマークするにはor "bzr resolve --all"を行います。3201 すべての衝突が解消されたものとしてマークするにはor "bzr resolve --done"を行います。
3202 3202
3203:関連コマンド: `bzr conflicts`3203:関連コマンド: `bzr conflicts`
32043204
32053205
=== modified file 'doc/ru/tutorials/centralized_workflow.txt'
--- doc/ru/tutorials/centralized_workflow.txt 2010-08-13 19:08:57 +0000
+++ doc/ru/tutorials/centralized_workflow.txt 2012-07-27 14:48:18 +0000
@@ -258,7 +258,7 @@
258разрешены все конфликты. В этом случае вы случайно не зафиксируете маркеры258разрешены все конфликты. В этом случае вы случайно не зафиксируете маркеры
259конфликта. Команда ``bzr status`` покажет конфликты и изменения, или можно259конфликта. Команда ``bzr status`` покажет конфликты и изменения, или можно
260использовать ``bzr conflicts`` что бы увидеть только конфликты.260использовать ``bzr conflicts`` что бы увидеть только конфликты.
261Используйте ``bzr resolve file/name``, или ``bzr resolve --all`` как261Используйте ``bzr resolve file/name``, или ``bzr resolve --done`` как
262только конфликты были разрешены. [#resolve]_ Если существуют конфликты262только конфликты были разрешены. [#resolve]_ Если существуют конфликты
263которые особенно сложно разрешить можно использовать команду ``bzr263которые особенно сложно разрешить можно использовать команду ``bzr
264remerge``. Эта команда позволит использовать другие алгоритмы объединения264remerge``. Эта команда позволит использовать другие алгоритмы объединения