Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

revert: allow multi-file revert

Changeset b760193a78c4

Parent 66c04754e391

by patrice.lacouture@gmail.com

Changes to one file · Browse files at b760193a78c4 Showing diff from parent 66c04754e391 Diff from another changeset...

 
17
18
19
20
 
21
22
23
24
25
26
27
 
28
29
30
31
32
33
 
 
 
 
 
 
 
 
 
34
35
36
 
57
58
59
60
 
 
61
62
63
 
17
18
19
 
20
21
22
23
24
25
26
 
27
28
29
30
31
 
 
32
33
34
35
36
37
38
39
40
41
42
43
 
64
65
66
 
67
68
69
70
71
@@ -17,20 +17,27 @@
 from tortoisehg.hgqt import cmdui, qtlib    class RevertDialog(QDialog): - def __init__(self, repo, wfile, rev, parent): + def __init__(self, repo, wfiles, rev, parent):   super(RevertDialog, self).__init__(parent)   self.setWindowTitle(_('Revert - %s') % repo.displayname)     f = self.windowFlags()   self.setWindowFlags(f & ~Qt.WindowContextHelpButtonHint)   self.repo = repo - self.wfile = repo.wjoin(wfile) + self.wfiles = [ repo.wjoin(wfile) for wfile in wfiles ]   self.rev = str(rev)     self.setLayout(QVBoxLayout())   - lbl = QLabel(_('<b>Revert %s to its contents at revision %d?</b>') % ( - wfile, rev)) + if len(wfile) == 1: + lblText = _('<b>Revert %s to its contents' + ' at revision %d?</b>') % ( + wfiles[0], rev) + else: + lblText = _('<b>Revert %d files to their contents' + ' at revision %d?</b>') % ( + len(wfiles), rev) + lbl = QLabel(lblText)   self.layout().addWidget(lbl)     self.allchk = QCheckBox(_('Revert all files to this revision')) @@ -57,7 +64,8 @@
  return   cmdline = ['revert', '--repository', self.repo.root, '--all']   else: - cmdline = ['revert', '--repository', self.repo.root, self.wfile] + cmdline = ['revert', '--repository', self.repo.root] + cmdline.extend(self.wfiles)   cmdline += ['--rev', self.rev]   self.bbox.button(QDialogButtonBox.Ok).setEnabled(False)   self.cmd.run(cmdline)