Skip to content

Commit c3af2ec

Browse files
authored
Merge pull request #4114 from cedk/hg-branches
Use quiet mode to retrieve branches from mercurial
2 parents d72972b + c1a76b7 commit c3af2ec

File tree

1 file changed

+12
-2
lines changed
  • readthedocs/vcs_support/backends

1 file changed

+12
-2
lines changed

readthedocs/vcs_support/backends/hg.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,24 @@ def clone(self):
3838

3939
@property
4040
def branches(self):
41-
retcode, stdout = self.run('hg', 'branches', record_as_success=True)[:2]
41+
retcode, stdout = self.run(
42+
'hg', 'branches', '--quiet', record_as_success=True)[:2]
4243
# error (or no tags found)
4344
if retcode != 0:
4445
return []
4546
return self.parse_branches(stdout)
4647

4748
def parse_branches(self, data):
48-
"""Stable / default"""
49+
"""
50+
Parses output of `hg branches --quiet`, eg:
51+
52+
default
53+
0.2
54+
0.1
55+
56+
Into VCSVersion objects with branch name as verbose_name and
57+
identifier.
58+
"""
4959
names = [name.lstrip() for name in data.splitlines()]
5060
return [VCSVersion(self, name, name) for name in names if name]
5161

0 commit comments

Comments
 (0)