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

Proposed by Martin Packman on 2012-07-27
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 2012-07-27 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 on 2012-07-27

Update some documentation to not mention resolve --all

6546. By Martin Packman on 2012-07-27

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

6545. By Martin Packman on 2012-07-27

Deprecate WorkingTree.auto_resolve

6544. By Martin Packman on 2012-07-27

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
1=== modified file 'bzrlib/conflicts.py'
2--- bzrlib/conflicts.py 2012-07-27 14:48:18 +0000
3+++ bzrlib/conflicts.py 2012-07-27 14:48:18 +0000
4@@ -34,6 +34,7 @@
5 trace,
6 transform,
7 workingtree,
8+ ui,
9 )
10 from bzrlib.i18n import gettext, ngettext
11 """)
12@@ -113,7 +114,7 @@
13
14 Once you have fixed a problem, use "bzr resolve" to automatically mark
15 text conflicts as fixed, "bzr resolve FILE" to mark a specific conflict as
16- resolved, or "bzr resolve --all" to mark all conflicts as resolved.
17+ resolved, or "bzr resolve --done" to mark all conflicts as resolved.
18 """
19 aliases = ['resolved']
20 takes_args = ['file*']
21@@ -125,22 +126,25 @@
22 _see_also = ['conflicts']
23 def run(self, file_list=None, all=False, action=None, directory=None):
24 if all:
25+ ui.ui_factory.show_user_warning(
26+ 'deprecated_command_option',
27+ deprecated_name='--all',
28+ recommended_name='bzr resolve --done',
29+ deprecated_in_version='2.6',
30+ command=self.invoked_as)
31 if file_list:
32 raise errors.BzrCommandError(gettext("If --all is specified,"
33 " no FILE may be provided"))
34- if directory is None:
35- directory = u'.'
36- tree = workingtree.WorkingTree.open_containing(directory)[0]
37 if action is None:
38 action = 'done'
39 else:
40- tree, file_list = workingtree.WorkingTree.open_containing_paths(
41- file_list, directory)
42 if action is None:
43 if file_list is None:
44 action = 'auto'
45 else:
46 action = 'done'
47+ tree, file_list = workingtree.WorkingTree.open_containing_paths(
48+ file_list, directory)
49 before, after = resolve(tree, file_list, action=action)
50 # GZ 2012-07-27: Should unify UI below now that auto is less magical.
51 if action == 'auto' and file_list is None:
52
53=== modified file 'bzrlib/tests/blackbox/test_remerge.py'
54--- bzrlib/tests/blackbox/test_remerge.py 2012-01-05 13:02:31 +0000
55+++ bzrlib/tests/blackbox/test_remerge.py 2012-07-27 14:48:18 +0000
56@@ -105,7 +105,7 @@
57 'remerge hello --reprocess',
58 retcode=1, working_dir='this')
59
60- self.run_bzr('resolve --all', working_dir='this')
61+ self.run_bzr('resolve --done', working_dir='this')
62 self.run_bzr('commit -m done', working_dir='this')
63
64 self.run_bzr_error(['remerge only works after normal merges',
65
66=== modified file 'bzrlib/tests/blackbox/test_resolve.py'
67--- bzrlib/tests/blackbox/test_resolve.py 2011-09-16 15:37:58 +0000
68+++ bzrlib/tests/blackbox/test_resolve.py 2012-07-27 14:48:18 +0000
69@@ -47,6 +47,16 @@
70 self.run_script("""\
71 $ cd branch
72 $ bzr resolve --all
73+2>The option '--all' to 'bzr resolve' has been deprecated in bzr 2.6. \
74+Please use 'bzr resolve --done' instead.
75+2>3 conflicts resolved, 0 remaining
76+$ bzr conflicts
77+""")
78+
79+ def test_resolve_done(self):
80+ self.run_script("""\
81+$ cd branch
82+$ bzr resolve --done
83 2>3 conflicts resolved, 0 remaining
84 $ bzr conflicts
85 """)
86@@ -68,6 +78,15 @@
87 def test_resolve_all_via_directory_option(self):
88 self.run_script("""\
89 $ bzr resolve -d branch --all
90+2>The option '--all' to 'bzr resolve' has been deprecated in bzr 2.6. \
91+Please use 'bzr resolve --done' instead.
92+2>3 conflicts resolved, 0 remaining
93+$ bzr conflicts -d branch
94+""")
95+
96+ def test_resolve_done_via_directory_option(self):
97+ self.run_script("""\
98+$ bzr resolve -d branch --done
99 2>3 conflicts resolved, 0 remaining
100 $ bzr conflicts -d branch
101 """)
102
103=== modified file 'bzrlib/tests/blackbox/test_too_much.py'
104--- bzrlib/tests/blackbox/test_too_much.py 2011-09-26 15:21:01 +0000
105+++ bzrlib/tests/blackbox/test_too_much.py 2012-07-27 14:48:18 +0000
106@@ -240,7 +240,7 @@
107 self.assert_('|||||||' in conflict_text)
108 self.assert_('hi world' in conflict_text)
109 self.run_bzr('revert')
110- self.run_bzr('resolve --all')
111+ self.run_bzr('resolve --done')
112 self.run_bzr('merge ../other', retcode=1)
113 conflict_text = file('hello').read()
114 self.assert_('|||||||' not in conflict_text)
115@@ -255,7 +255,7 @@
116 result = self.run_bzr('conflicts')[0]
117 self.assertEquals(result, "Text conflict in question\n")
118 self.run_bzr('commit -m conflicts', retcode=3)
119- self.run_bzr('resolve --all')
120+ self.run_bzr('resolve --done')
121 result = self.run_bzr('conflicts')[0]
122 self.run_bzr('commit -m conflicts')
123 self.assertEquals(result, "")
124
125=== modified file 'doc/en/tutorials/centralized_workflow.txt'
126--- doc/en/tutorials/centralized_workflow.txt 2011-04-06 04:58:43 +0000
127+++ doc/en/tutorials/centralized_workflow.txt 2012-07-27 14:48:18 +0000
128@@ -256,7 +256,7 @@
129 conflicts. That way you don't accidentally commit the conflict markers.
130 The command ``bzr status`` will show the conflicts along with the other
131 changes, or you can use ``bzr conflicts`` to just list conflicts. Use
132-``bzr resolve file/name`` or ``bzr resolve --all`` once conflicts have
133+``bzr resolve file/name`` or ``bzr resolve --done`` once conflicts have
134 been handled. [#resolve]_ If you have a conflict that is particularly
135 difficult to solve you may want to use the ``bzr remerge`` command. It
136 will let you try different merge algorithms, as well as let you see the
137
138=== modified file 'doc/ja/tutorials/centralized_workflow.txt'
139--- doc/ja/tutorials/centralized_workflow.txt 2011-05-18 13:12:59 +0000
140+++ doc/ja/tutorials/centralized_workflow.txt 2012-07-27 14:48:18 +0000
141@@ -228,7 +228,7 @@
142 そのため、間違って競合マーカーをコミットしてしまうことはありません。
143 ``bzr status`` コマンドを使えば、他の変更内容と一緒に競合の情報も表示されます。
144 ``bzr conflicts`` なら、競合の情報だけが表示されます。
145-競合を解決し終わったら、``bzr resolve file/name`` か ``bzr resolve --all`` を実行してください。
146+競合を解決し終わったら、``bzr resolve file/name`` か ``bzr resolve --done`` を実行してください。
147 [#resolve]_ もし、解決が特に難しい競合がある場合は、 ``bzr remerge`` コマンドを使いたいと思うかもしれません。
148 このコマンドで、別のマージアルゴリズムを試してみることができ、さらに元のソース行を表示する\
149 こともできます。(``--show-base``)
150
151=== modified file 'doc/ja/user-reference/index.txt'
152--- doc/ja/user-reference/index.txt 2011-05-18 06:01:08 +0000
153+++ doc/ja/user-reference/index.txt 2012-07-27 14:48:18 +0000
154@@ -3198,7 +3198,7 @@
155
156 一旦問題を修正すれば、自動的にテキストの衝突を修正したものとしてマークするために"bzr resolve"を使用し、
157 特定の衝突を解消したものとしてマークするためにFILEをresolveします。
158- すべての衝突が解消されたものとしてマークするにはor "bzr resolve --all"を行います。
159+ すべての衝突が解消されたものとしてマークするにはor "bzr resolve --done"を行います。
160
161 :関連コマンド: `bzr conflicts`
162
163
164=== modified file 'doc/ru/tutorials/centralized_workflow.txt'
165--- doc/ru/tutorials/centralized_workflow.txt 2010-08-13 19:08:57 +0000
166+++ doc/ru/tutorials/centralized_workflow.txt 2012-07-27 14:48:18 +0000
167@@ -258,7 +258,7 @@
168 разрешены все конфликты. В этом случае вы случайно не зафиксируете маркеры
169 конфликта. Команда ``bzr status`` покажет конфликты и изменения, или можно
170 использовать ``bzr conflicts`` что бы увидеть только конфликты.
171-Используйте ``bzr resolve file/name``, или ``bzr resolve --all`` как
172+Используйте ``bzr resolve file/name``, или ``bzr resolve --done`` как
173 только конфликты были разрешены. [#resolve]_ Если существуют конфликты
174 которые особенно сложно разрешить можно использовать команду ``bzr
175 remerge``. Эта команда позволит использовать другие алгоритмы объединения