Changeset - ff0646d1a1b4
[Not reviewed]
beta
0 1 0
Mads Kiilerich - 13 years ago 2013-03-19 22:50:28
madski@unity3d.com
Transplanted from: 10187d0a89fc
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.)
1 file changed with 8 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/backends/hg/repository.py
Show inline comments
 
@@ -76,12 +76,19 @@ class MercurialRepository(BaseRepository
 
        return os.path.basename(self.path)
 

	
 
    @LazyProperty
 
    def branches(self):
 
        return self._get_branches()
 

	
 
    @LazyProperty
 
    def allbranches(self):
 
        """
 
        List all branches, including closed branches.
 
        """
 
        return self._get_branches(closed=True)
 

	
 
    def _get_branches(self, closed=False):
 
        """
 
        Get's branches for this repository
 
        Returns only not closed branches by default
 

	
 
        :param closed: return also closed branches for mercurial
 
@@ -457,13 +464,13 @@ class MercurialRepository(BaseRepository
 
        end_pos = self.revisions.index(end_raw_id) if end else None
 

	
 
        if None not in [start, end] and start_pos > end_pos:
 
            raise RepositoryError("Start revision '%s' cannot be "
 
                                  "after end revision '%s'" % (start, end))
 

	
 
        if branch_name and branch_name not in self.branches.keys():
 
        if branch_name and branch_name not in self.allbranches.keys():
 
            raise BranchDoesNotExistError('Branch %s not found in'
 
                                  ' this repository' % branch_name)
 
        if end_pos is not None:
 
            end_pos += 1
 

	
 
        slice_ = reversed(self.revisions[start_pos:end_pos]) if reverse else \
0 comments (0 inline, 0 general)