Mercurial > evolve
comparison hgext3rd/topic/stack.py @ 2936:3a9303b7b648
topics: show working directory branch when topic is empty
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 15 Sep 2017 22:48:55 +0530 |
parents | 5b514ab2ab4e |
children | b54abc7e80e2 |
comparison
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 """ |