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

stable chunks: use a lower patching API, properly subclass repo.ui instance

Changeset 9dfebd5cbc25

Parent ba4c20dcb045

by Steve Borho

Changes to one file · Browse files at 9dfebd5cbc25 Showing diff from parent ba4c20dcb045 Diff from another changeset...

 
100
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
 
100
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
@@ -100,27 +100,32 @@
  self.refresh()     def runPatcher(self, fp, wfile, updatestate): - class warncapt(uimod.ui): + ui = self.repo.ui.copy() + class warncapt(ui.__class__):   def warn(self, msg, *args, **opts):   self.write(msg) + ui.__class__ = warncapt + + ok = True   repo = self.repo - ui = warncapt()   ui.pushbuffer() - strip, pfiles = 1, {} - ok = True + pfiles = {} + curdir = os.getcwd()   try: - patch.internalpatch(fp, ui, strip, repo.root, files=pfiles, - eolmode=None) + os.chdir(repo.root) + if patch.applydiff(ui, fp, pfiles) < 0: + ok = False + self.showMessage.emit(_('Patch failed to apply'))   except patch.PatchError, err:   ok = False   self.showMessage.emit(hglib.tounicode(str(err))) + os.chdir(curdir)   for line in ui.popbuffer().splitlines():   if line.endswith(wfile + '.rej'):   if qtlib.QuestionMsgBox(_('Manually resolve rejected chunks?'),   hglib.tounicode(line) + u'<br><br>' +   _('Edit patched file and rejects?'),   parent=self): - #wctxactions.edit(self, repo.ui, repo, [wfile, wfile+'.rej'])   from tortoisehg.hgqt import rejects   dlg = rejects.RejectsDialog(repo.wjoin(wfile), self)   if dlg.exec_() == QDialog.Accepted: