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

qrename small improvement

Changeset 339a2e9f49c9

Parent 10e5f21b014b

by patrice@lacouture.nom.fr

Changes to one file · Browse files at 339a2e9f49c9 Showing diff from parent 10e5f21b014b Diff from another changeset...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
60
61
62
63
64
65
66
 # qrename.py - QRename dialog for TortoiseHg  #  # Copyright 2010 Steve Borho <steve@borho.org>  # Copyright 2010 Johan Samyn <johan.samyn@gmail.com>  #  # This software may be used and distributed according to the terms of the  # GNU General Public License version 2, incorporated herein by reference.    import os    from PyQt4.QtCore import *  from PyQt4.QtGui import *    from tortoisehg.util import hglib  from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import cmdui    class QRenameDialog(QDialog):     output = pyqtSignal(QString, QString)   makeLogVisible = pyqtSignal(bool)     def __init__(self, repo, patchname, parent):   super(QRenameDialog, self).__init__(parent)   self.setWindowTitle(_('Patch rename - %s') % repo.displayname)     f = self.windowFlags()   self.setWindowFlags(f & ~Qt.WindowContextHelpButtonHint)   self.setMinimumWidth(400)   self.repo = repo   self.oldpatchname = patchname   self.newpatchname = ''     self.setLayout(QVBoxLayout())     lbl = QLabel(_('Rename patch <b>%s</b> to:') % (self.oldpatchname))   self.layout().addWidget(lbl)   - self.le = QLineEdit('') + self.le = QLineEdit(hglib.tounicode(self.oldpatchname))   self.layout().addWidget(self.le)     self.cmd = cmdui.Runner()   self.cmd.output.connect(self.output)   self.cmd.makeLogVisible.connect(self.makeLogVisible)   self.cmd.commandFinished.connect(self.reject)     BB = QDialogButtonBox   bbox = QDialogButtonBox(BB.Ok|BB.Cancel)   bbox.accepted.connect(self.accept)   bbox.rejected.connect(self.reject)   self.layout().addWidget(bbox)   self.bbox = bbox     self.focus = self.le     def accept(self):   self.newpatchname = hglib.fromunicode(self.le.text())   cmdline = ['qrename', '--repository', self.repo.root, '--',   self.oldpatchname, self.newpatchname] - self.cmd.run(cmdline) + if self.newpatchname != self.oldpatchname: + cmdline = ['qrename', '--repository', self.repo.root, '--', + self.oldpatchname, self.newpatchname] + self.cmd.run(cmdline) + else: + self.close() +