hgext3rd/topic/stack.py
changeset 2936 3a9303b7b648
parent 2919 5b514ab2ab4e
child 2937 b54abc7e80e2
equal deleted inserted replaced
2935:6f7f8c6fcfb0 2936:3a9303b7b648
   167                 return -1
   167                 return -1
   168         return 0
   168         return 0
   169 
   169 
   170     @util.propertycache
   170     @util.propertycache
   171     def branches(self):
   171     def branches(self):
   172         return sorted(set(self._repo[r].branch() for r in self._revs))
   172         branches = sorted(set(self._repo[r].branch() for r in self._revs))
       
   173         if not branches:
       
   174             branches = set([self._repo[None].branch()])
       
   175         return branches
   173 
   176 
   174 def labelsgen(prefix, labelssuffix):
   177 def labelsgen(prefix, labelssuffix):
   175     """ Takes a label prefix and a list of suffixes. Returns a string of the prefix
   178     """ Takes a label prefix and a list of suffixes. Returns a string of the prefix
   176     formatted with each suffix separated with a space.
   179     formatted with each suffix separated with a space.
   177     """
   180     """