Mercurial > kallithea
comparison rhodecode/lib/vcs/backends/hg/repository.py @ 3555:ff0646d1a1b4 beta
changelog: make it possible to use closed branches in ?branch=...
Closed branches in Mercurial are just not announced. It should still be
possible to use them. (And arguably there should also be a way to explore them
in the UI.)
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Tue, 19 Mar 2013 22:50:28 +0100 |
parents | 189ce0d7b7c6 |
children | 000653f7cdf9 |
comparison
equal
deleted
inserted
replaced
3554:189ce0d7b7c6 | 3555:ff0646d1a1b4 |
---|---|
76 return os.path.basename(self.path) | 76 return os.path.basename(self.path) |
77 | 77 |
78 @LazyProperty | 78 @LazyProperty |
79 def branches(self): | 79 def branches(self): |
80 return self._get_branches() | 80 return self._get_branches() |
81 | |
82 @LazyProperty | |
83 def allbranches(self): | |
84 """ | |
85 List all branches, including closed branches. | |
86 """ | |
87 return self._get_branches(closed=True) | |
81 | 88 |
82 def _get_branches(self, closed=False): | 89 def _get_branches(self, closed=False): |
83 """ | 90 """ |
84 Get's branches for this repository | 91 Get's branches for this repository |
85 Returns only not closed branches by default | 92 Returns only not closed branches by default |
458 | 465 |
459 if None not in [start, end] and start_pos > end_pos: | 466 if None not in [start, end] and start_pos > end_pos: |
460 raise RepositoryError("Start revision '%s' cannot be " | 467 raise RepositoryError("Start revision '%s' cannot be " |
461 "after end revision '%s'" % (start, end)) | 468 "after end revision '%s'" % (start, end)) |
462 | 469 |
463 if branch_name and branch_name not in self.branches.keys(): | 470 if branch_name and branch_name not in self.allbranches.keys(): |
464 raise BranchDoesNotExistError('Branch %s not found in' | 471 raise BranchDoesNotExistError('Branch %s not found in' |
465 ' this repository' % branch_name) | 472 ' this repository' % branch_name) |
466 if end_pos is not None: | 473 if end_pos is not None: |
467 end_pos += 1 | 474 end_pos += 1 |
468 | 475 |