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

stable thgrepo: livebranches was already implemented as namedbranches

Changeset 067a5dc46d11

Parent 0ff506605e74

by Steve Borho

Changes to 4 files · Browse files at 067a5dc46d11 Showing diff from parent 0ff506605e74 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
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
 # 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()   for p in wctx.parents():   branchCombo.addItem(hglib.tounicode(p.branch()))   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.livebranches: + 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)   layout.addLayout(grid)     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('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)
 
209
210
211
212
 
213
214
215
 
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
 
209
210
211
 
212
213
214
215
 
241
242
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
245
246
@@ -209,7 +209,7 @@
   _uiprops = '''_uifiles _uimtime _shell postpull tabwidth maxdiff   deadbranches _exts _thghiddentags displayname summarylen - shortname mergetools livebranches namedbranches'''.split() + shortname mergetools namedbranches'''.split()  _thgrepoprops = '''_thgmqpatchnames thgmqunappliedpatches   _branchheads'''.split()   @@ -241,22 +241,6 @@
  return changectx     @propertycache - def livebranches(self): - '''return a list of live branch names in unicode''' - lives = [] - cl = self.changelog - for branch, heads in self.branchmap().iteritems(): - if branch in self.deadbranches: - continue - bheads = [h for h in heads if ('close' not in cl.read(h)[5])] - if not bheads: - # ignore branches with all heads closed - continue - lives.append(hglib.tounicode(branch)) - lives.sort() - return lives - - @propertycache   def _thghiddentags(self):   ht = self.ui.config('tortoisehg', 'hidetags', '')   return [t.strip() for t in ht.split()]
 
58
59
60
61
 
62
63
64
 
58
59
60
 
61
62
63
64
@@ -58,7 +58,7 @@
  rev = str(rev)   combo.addItem(hglib.tounicode(rev))   combo.setCurrentIndex(0) - for name in self.repo.livebranches: + for name in self.repo.namedbranches:   combo.addItem(name)     tags = list(self.repo.tags())
 
52
53
54
55
 
56
57
58
 
52
53
54
 
55
56
57
58
@@ -52,7 +52,7 @@
  combo.addItem(hglib.tounicode(rev))   combo.setCurrentIndex(0)   - for name in repo.livebranches: + for name in repo.namedbranches:   combo.addItem(name)     tags = list(self.repo.tags())