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

rename: simplify init of --after option

Changeset de6c55c65fcd

Parent 3438db19a8e5

by Johan Samyn

Changes to one file · Browse files at de6c55c65fcd Showing diff from parent 3438db19a8e5 Diff from another changeset...

 
26
27
28
29
 
30
31
32
33
 
 
34
35
 
36
37
38
 
58
59
60
61
62
63
64
65
 
66
67
68
 
148
149
150
151
 
152
153
154
 
219
220
221
222
223
224
225
226
227
228
 
232
233
234
235
 
236
237
238
 
26
27
28
 
29
30
31
 
 
32
33
34
 
35
36
37
38
 
58
59
60
 
61
62
63
 
64
65
66
67
 
147
148
149
 
150
151
152
153
 
218
219
220
 
 
 
 
221
222
223
 
227
228
229
 
230
231
232
233
@@ -26,13 +26,13 @@
    def __init__(self, ui, pats, parent=None, **opts):   super(RenameDialog, self).__init__(parent=None) - iscopy = (opts.get('alias') == 'copy') + self.iscopy = (opts.get('alias') == 'copy')   src = ''   dest = '' - src, dest = self.init_data(ui, pats, iscopy) - self.init_view(src, dest, iscopy) + src, dest = self.init_data(ui, pats) + self.init_view(src, dest)   - def init_data(self, ui, pats, iscopy): + def init_data(self, ui, pats):   """calculate initial values for widgets"""   fname = ''   target = '' @@ -58,11 +58,10 @@
  target = hglib.toutf(fname)   self.opts = {}   self.opts['force'] = False # Checkbox? Nah. - self.opts['after'] = (not iscopy)   self.opts['dry_run'] = False   return (fname, target)   - def init_view(self, src, dest, iscopy): + def init_view(self, src, dest):   """define the view"""     # widgets @@ -148,7 +147,7 @@
  # dialog setting   self.setWindowIcon(qtlib.geticon('rename'))   self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) - self.copy_chk.setChecked(iscopy) + self.copy_chk.setChecked(self.iscopy)   self.setLayout(self.vbox)   self.layout().setSizeConstraint(QLayout.SetFixedSize)   self.dest_txt.setFocus() @@ -219,10 +218,6 @@
    def copy_chk_toggled(self):   self.setRenameCopy() - if self.copy_chk.isChecked(): - self.opts['after'] = False - else: - self.opts['after'] = True   self.show_command(self.compose_command(self.get_src(), self.get_dest()))     def compose_command(self, src, dest): @@ -232,7 +227,7 @@
  cmdline = ['rename']   cmdline += ['-R', self.repo.root]   cmdline.append('-v') - if self.opts['after']: + if not self.copy_chk.isChecked():   cmdline.append('-A')   cmdline.append(hglib.fromunicode(src))   cmdline.append(hglib.fromunicode(dest))