Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

merge: allow to force the merge tool

Changeset ec2e14436f2e

Parent 26b46e36e597

by Simon Heimberg

Changes to one file · Browse files at ec2e14436f2e Showing diff from parent 26b46e36e597 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​merge.py Stacked
 
87
88
89
 
 
 
 
 
 
 
 
 
 
 
 
90
91
92
 
98
99
100
 
 
 
 
101
102
103
104
105
106
 
 
 
 
 
107
108
109
 
110
111
112
 
141
142
143
 
144
145
146
 
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 
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
 
163
164
165
166
167
168
169
@@ -87,6 +87,18 @@
  hbbox.add(undo)   hbbox.add(close)   + vlist = gtk.ListStore(str, bool) + combo = gtk.ComboBoxEntry(vlist, 0) + self.mergetool = combo + combo.set_row_separator_func(lambda model, path: model[path][1]) + combo.child.set_width_chars(8) + lbl = gtk.Label(_('mergetool:')) + hbbox.add(lbl) + hbbox.add(combo) + vlist.append(('', False)) + for tool in hglib.mergetools(repo.ui): + vlist.append((hglib.toutf(tool), False)) +   commit.connect('clicked', self.commit)   undo.connect('clicked', self.undo, local, merge, commit)   merge.connect('clicked', self.merge, other, commit, undo) @@ -98,15 +110,25 @@
    def merge(self, button, other, commit, undo):   cmdline = ['hg', 'merge', '--rev', other] + tool = hglib.fromutf(self.mergetool.child.get_text()) + if tool: + oldmergeenv = os.environ.get('HGMERGE') + os.environ['HGMERGE'] = tool   dlg = hgcmd.CmdDialog(cmdline)   dlg.run()   dlg.hide()   repo = hg.repository(ui.ui(), path=paths.find_root())   if len(repo.parents()) == 1:   return + if tool: + if oldmergeenv: + os.environ['HGMERGE'] = oldmergeenv + else: + del os.environ['HGMERGE']   if self.notify_func:   self.notify_func(self.notify_args)   button.set_sensitive(False) + self.mergetool.set_sensitive(False)   undo.set_sensitive(True)   commit.set_sensitive(True)   commit.grab_focus() @@ -141,6 +163,7 @@
  button.set_sensitive(False)   commit.set_sensitive(False)   merge.set_sensitive(True) + self.mergetool.set_sensitive(True)   merge.grab_focus()    def run(ui, *pats, **opts):