Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0, 2.0.1, and 2.0.2

stable patches: add more text, needs four new figures

import.png, patchqueue.png, mqtasktab.png, rejects.png

Changeset 3dce66551fe6

Parent 83ce2719c713

by Steve Borho

Changes to one file · Browse files at 3dce66551fe6 Showing diff from parent 83ce2719c713 Diff from another changeset...

 
1
2
3
4
 
45
46
47
48
49
50
 
51
52
53
 
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
 
136
137
138
139
 
 
 
140
141
142
 
143
144
145
146
147
 
 
 
 
 
 
 
148
149
150
 
156
157
158
159
 
160
161
 
162
163
164
165
166
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
169
 
 
1
2
3
 
44
45
46
 
 
 
47
48
49
50
 
101
102
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
105
106
107
108
109
 
110
111
 
 
 
112
113
114
115
116
 
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
 
138
139
140
 
141
142
 
143
144
 
 
 
 
 
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
@@ -1,4 +1,3 @@
-*******  Patches  *******   @@ -45,9 +44,7 @@
  The only downside is that you cannot make a patch that changes the   line endings of a source file.   -The work on the hgeol extension is also improving this area. Perhaps it -will be resolved by hg-1.5. See also the -`patch section <http://www.selenic.com/mercurial/hgrc.5.html#patch>`_ +See also the `patch section <http://www.selenic.com/mercurial/hgrc.5.html#patch>`_  of the hgrc documentation.    Applying a patch is not a foolproof operation. If the source file has @@ -104,47 +101,32 @@
  `SMTP <http://www.selenic.com/mercurial/hgrc.5.html#smtp>`_   to send patches via email   -Cherry Picking --------------- - -Use the changeset range selection feature of the Repository Explorer and -select :menuselection:`Diff with selected`. This opens up a status -viewer showing you the accumulated changes between your base and target -changesets. - -From the status viewer, you can select files and diff hunks just as you -can in the commit tool, and preview the final result in the -:guilabel:`Save Preview` tab. Pressing :guilabel:`Save As` will save -the selected changes to a patch file. - -For even finer cherry-picking, you can highlight a number of diff-hunks -in the hunk selection pane and hit CTRL-C. This will copy the -highlighted (mouse selected, not toggled) hunks to the clipboard. - -.. note:: - Reversing the order of your changeset selection reverses the effect - of the patch. - -  Import Patches  ==============    .. figure:: figures/import.png   :alt: Import tool   - Import dialog of Repository Explorer + Import dialog of the WorkBench   -The import dialog can be opened from the sync bar or menu of the -Repository Explorer, or via :command:`thg import`. The dialog supports -file and directory drag and drop. +The import dialog can be opened from the :guilabel:`Repository` menu of +the Workbench, or via :command:`thg import`. The dialog supports file +and directory drag and drop.    You have the choice of importing directly into the repository, the -working folder, or your patch queue. +working folder, a shelf file, or your patch queue.    .. note::   Importing a patch requires a clean working directory state. You   must commit, revert, or shelve changes before importing a patch.   +.. note:: + If a patch does not import itself cleanly into the repository, the + recommended recourse is to import the patch into your patch queue + (qimport) and then qpush the patch. This uses TortoiseHg patch + rejection dialog and preserves the meta-data in the patch header. + Do not forget to qrefresh after resolving the rejected chunks. +  .. warning::   If the patch you are importing does not have a commit   message, Mercurial will try to launch your editor, just as if you @@ -156,14 +138,67 @@
 ============    .. figure:: figures/patchqueue.png - :alt: Patch Queue + :alt: Patch Queue in Workbench   - Patch Queue panel in the Repository Explorer + A patch queue in the repository graph   -Both the Repository Explorer and Commit Tool have an optional Patch -Queue panel that is only available when the user has enabled the MQ -extension. It allows the user to perform most patch queue operations -including push, pop, rename, and finish. It's recommended to learn the -MQ extension before using the Patch Queue panel. +When MQ is enabled, several Workbench features are exposed. Context menu +options are exposed in the changeset menus, your patch queue is graphed +together with your repository's history, and a Patch Queue task tab is +activated. + +.. figure:: figures/mqtasktab.png + :alt: Patch Queue Task Tab + + MQ tool or task tab + +The :guilabel:`Patch Queue` task tab is also available as :command:`thg +mq` from the command line. Most MQ features are available from the +Patch Queue task tab, though a few features (qimport -r/qfinish) are +only supported via revision graph context menus. Much functionality is +supported in both places. + +Double clicking on an unapplied patch, an applied patch other than the +current qtip, or the qparent triggers a qgoto command; making the double +clicked revision the current patch. Double clicking on any other +revision will trigger a visual diff of that revision. + +.. note:: + The Workbench must be restarted after enabling or disabling the MQ + extension in a repository. This is true of most extensions. + +.. note:: + It is recommended to learn the MQ extension before using the MQ + features of the Workbench. + +Patch Rejects +============= + +As explained previously, patches are not guarunteed to apply cleanly to +their intended source files. Prior to TortoiseHg 2.0, the only recourse +available when patch chunks were rejected was to open the source file +and the rejects file in an editor and manually fixup the rejected +chunks. + +TortoiseHg 2.0 introduces a dialog that makes this a little bit easier. +If the shelve tool detects chunk rejections, it offers to open the +rejected chunks in the rejects editor. The MQ tool also does this for +qpush commands. + +.. figure:: figures/rejects.png + :alt: Patch Rejects Editor + + Resolve rejected patch chunks + +The rejects editor is very basic. Your source file is opened in a +Qscintilla2 window for edit. Below the source file is the list of +chunks that failed to apply to this file. When you click on a chunk in +the list the editor jumps to the line where the chunk context was +supposed to match. It is up to you to figure out why the chunk did not +apply and to resolve it (perhaps even by ignoring the chunk). The +resolved/unresolved states are for your own book keeping, so you know +when all of the chunks have been dealt with. Once you have marked all +of the chunks resolved, the :guilabel:`Save` button will become +sensitive.    .. vim: noet ts=4