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: add a propertycache for sorted live branches

Changeset cc866f2fcafa

Parent a479c0ded724

by Steve Borho

Changes to one file · Browse files at cc866f2fcafa Showing diff from parent a479c0ded724 Diff from another changeset...

 
209
210
211
212
 
213
214
215
 
241
242
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
245
246
 
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,7 +209,7 @@
   _uiprops = '''_uifiles _uimtime _shell postpull tabwidth maxdiff   deadbranches _exts _thghiddentags displayname summarylen - shortname mergetools'''.split() + shortname mergetools livebranches'''.split()  _thgrepoprops = '''_thgmqpatchnames thgmqunappliedpatches   _branchheads'''.split()   @@ -241,6 +241,22 @@
  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()]