Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph

default Merge with stable

Changeset 8cf34332ed01

Parents 57fa0272f191

Parents c5b82b5a2bc7

by Steve Borho

Changes to 4 files · Browse files at 8cf34332ed01 Showing diff from parent 57fa0272f191 c5b82b5a2bc7 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
61
62
63
64
65
 
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
 # branchop.py - branch operations dialog for TortoiseHg commit tool  #  # Copyright 2010 Steve Borho <steve@borho.org>  #  # 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.hgqt.i18n import _  from tortoisehg.util import hglib    from tortoisehg.hgqt import qtlib    class BranchOpDialog(QDialog):   'Dialog for manipulating wctx.branch()'   def __init__(self, repo, oldbranchop, parent=None):   QDialog.__init__(self, parent)   self.setWindowTitle(_('%s - branch operation') % repo.displayname)   self.setWindowIcon(qtlib.geticon('branch'))   layout = QVBoxLayout()   self.setLayout(layout)   wctx = repo[None]     if len(wctx.parents()) == 2:   lbl = QLabel('<b>'+_('Select branch of merge commit')+'</b>')   layout.addWidget(lbl)   branchCombo = QComboBox()   # If both parents belong to the same branch, do not duplicate the   # branch name in the branch select combo   branchlist = [p.branch() for p in wctx.parents()]   if branchlist[0] == branchlist[1]:   branchlist = [branchlist[0]]   for b in branchlist:   branchCombo.addItem(hglib.tounicode(b))   layout.addWidget(branchCombo)   else:   text = '<b>'+_('Changes take effect on next commit')+'</b>'   lbl = QLabel(text)   layout.addWidget(lbl)     grid = QGridLayout()   nochange = QRadioButton(_('No branch changes'))   newbranch = QRadioButton(_('Open a new named branch'))   closebranch = QRadioButton(_('Close current branch'))   branchCombo = QComboBox()   branchCombo.setEditable(True)     wbu = hglib.tounicode(wctx.branch())   for name in repo.namedbranches:   if name == wbu:   continue   branchCombo.addItem(name)   branchCombo.activated.connect(self.accept)     grid.addWidget(nochange, 0, 0)   grid.addWidget(newbranch, 1, 0)   grid.addWidget(branchCombo, 1, 1)   grid.addWidget(closebranch, 2, 0)   grid.setColumnStretch(0, 0)   grid.setColumnStretch(1, 1)   layout.addLayout(grid) + layout.addStretch()     newbranch.toggled.connect(branchCombo.setEnabled)   branchCombo.setEnabled(False)   if oldbranchop is None:   nochange.setChecked(True)   elif oldbranchop == False:   closebranch.setChecked(True)   else:   assert type(oldbranchop) == QString   bc = branchCombo   names = [bc.itemText(i) for i in xrange(bc.count())]   if oldbranchop in names:   bc.setCurrentIndex(names.index(oldbranchop))   else:   bc.addItem(oldbranchop)   bc.setCurrentIndex(len(names))   newbranch.setChecked(True)   self.closebranch = closebranch     BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Ok|BB.Cancel)   bb.accepted.connect(self.accept)   bb.rejected.connect(self.reject)   bb.button(BB.Ok).setAutoDefault(True)   layout.addWidget(bb)   self.bb = bb   self.branchCombo = branchCombo   QShortcut(QKeySequence('Ctrl+Return'), self, self.accept)   QShortcut(QKeySequence('Ctrl+Enter'), self, self.accept)   QShortcut(QKeySequence('Escape'), self, self.reject)     def accept(self):   '''Branch operation is one of:   None - leave wctx branch name untouched   False - close current branch   QString - open new named branch   '''   if self.branchCombo.isEnabled():   self.branchop = self.branchCombo.currentText()   elif self.closebranch.isChecked():   self.branchop = False   else:   self.branchop = None   QDialog.accept(self)
 
289
290
291
292
 
293
294
295
 
289
290
291
 
292
293
294
295
@@ -289,7 +289,7 @@
  return   else:   try: - targetdir = os.path.dirname(dest) + targetdir = os.path.dirname(fulldest)   if not os.path.isdir(targetdir):   os.makedirs(targetdir)   os.rename(fullsrc, fulldest)
 
11
12
13
14
 
15
16
17
 
1788
1789
1790
 
1791
1792
1793
 
11
12
13
 
14
15
16
17
 
1788
1789
1790
1791
1792
1793
1794
@@ -11,7 +11,7 @@
   from mercurial import revset, error, patch   -from tortoisehg.util import hglib +from tortoisehg.util import hglib, shlib    from tortoisehg.hgqt.i18n import _  from tortoisehg.hgqt import qtlib @@ -1788,6 +1788,7 @@
    def onCommandFinished(self, ret):   self.repo.decrementBusyCount() + shlib.shell_notify(self.repo.root)     def runCommand(self, *cmdlines):   if self.runner.core.running():
 
222
223
224
 
 
225
226
227
228
229
230
231
232
 
 
233
234
235
236
237
238
 
 
239
240
241
242
243
244
245
246
247
 
 
248
249
250
251
 
 
252
253
254
 
465
466
467
468
469
 
 
470
471
472
 
222
223
224
225
226
227
228
229
230
231
232
 
 
233
234
235
 
236
 
 
 
237
238
239
240
241
242
243
244
 
 
 
245
246
247
 
 
 
248
249
250
251
252
 
463
464
465
 
 
466
467
468
469
470
@@ -222,33 +222,31 @@
  self.securebutton = a   tbar.addWidget(qtlib.Spacer(2, 2))   + self.hostAndPortActions = [] +   fontm = QFontMetrics(self.font())   self.hostentry = QLineEdit()   self.hostentry.setToolTip(_('Hostname'))   self.hostentry.setAcceptDrops(False)   self.hostentry.setFixedWidth(30 * fontm.width('9'))   self.hostentry.textChanged.connect(self.refreshUrl) - tbar.addWidget(self.hostentry) - tbar.addWidget(qtlib.Spacer(2, 2)) + self.hostAndPortActions.append(tbar.addWidget(self.hostentry)) + self.hostAndPortActions.append(tbar.addWidget(qtlib.Spacer(2, 2)))   - self.HostAndPortWidgets = [self.hostentry]   w = QLabel(':') - tbar.addWidget(w) - tbar.addWidget(qtlib.Spacer(2, 2)) - self.HostAndPortWidgets.append(w) + self.hostAndPortActions.append(tbar.addWidget(w)) + self.hostAndPortActions.append(tbar.addWidget(qtlib.Spacer(2, 2)))   self.portentry = QLineEdit()   self.portentry.setAcceptDrops(False)   self.portentry.setToolTip(_('Port'))   self.portentry.setFixedWidth(8 * fontm.width('9'))   self.portentry.setValidator(QIntValidator(0, 65536, self.portentry))   self.portentry.textChanged.connect(self.refreshUrl) - tbar.addWidget(self.portentry) - tbar.addWidget(qtlib.Spacer(2, 2)) - self.HostAndPortWidgets.append(self.portentry) + self.hostAndPortActions.append(tbar.addWidget(self.portentry)) + self.hostAndPortActions.append(tbar.addWidget(qtlib.Spacer(2, 2)))   w = QLabel('/') - tbar.addWidget(w) - tbar.addWidget(qtlib.Spacer(2, 2)) - self.HostAndPortWidgets.append(w) + self.hostAndPortActions.append(tbar.addWidget(w)) + self.hostAndPortActions.append(tbar.addWidget(qtlib.Spacer(2, 2)))   self.pathentry = QLineEdit()   self.pathentry.setAcceptDrops(False)   self.pathentry.setToolTip(_('Path')) @@ -465,8 +463,8 @@
  return   self.urllabel.setText(hglib.tounicode(self.currentUrl(True)))   schemeIndex = self.schemecombo.currentIndex() - for w in self.HostAndPortWidgets: - w.setDisabled(schemeIndex == 0) + for w in self.hostAndPortActions: + w.setVisible(schemeIndex != 0)   self.securebutton.setVisible(schemeIndex >= 3)     opts = []