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

chunks: add a minimal interactive fall-back method for rejected chunks

Someone could make a nice dialog with side-by-side Qscintillas. On the left,
there would be the patched file and on the right would be the rejected chunks.
Click on a chunk header and it jumps to the line of the source file it wanted
to apply the chunk.

Changeset 61db2b290943

Parent 5291df35db36

by Steve Borho

Changes to one file · Browse files at 61db2b290943 Showing diff from parent 5291df35db36 Diff from another changeset...

 
22
23
24
 
 
 
 
25
26
27
 
111
112
113
114
115
116
 
 
 
 
 
 
 
 
 
 
 
 
 
117
118
119
 
22
23
24
25
26
27
28
29
30
31
 
115
116
117
 
 
 
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@@ -22,6 +22,10 @@
 from PyQt4.QtGui import *  from PyQt4 import Qsci   +# TODO +# Add support for tools like TortoiseMerge that help resolve rejected chunks +# qpush and import could benefit from patch reject fallbacks as well +  qsci = Qsci.QsciScintilla    class ChunksWidget(QWidget): @@ -111,9 +115,19 @@
  self.showMessage.emit(hglib.tounicode(str(err)))   for line in ui.popbuffer().splitlines():   if line.endswith(wfile + '.rej'): - print 'reject file created for', wfile - # TODO: ask user if they want to edit file + .rej - # TODO: ask user if it is ok to remove chunks from source + if qtlib.QuestionMsgBox(_('Manually resolve rejected chunks?'), + unicode(line) + u'<br><br>' + + _('Edit patched file and rejects?'), + parent=self): + wctxactions.edit(self, repo.ui, repo, [wfile, wfile+'.rej']) + else: + return False + if qtlib.QuestionMsgBox(_('Were the rejected chunks resolved?'), + _('Remove these chunks from their source?'), + parent=self): + ok = True + else: + break   if updatestate and ok:   # Apply operations specified in git diff headers   hglib.updatedir(repo.ui, repo, pfiles)