Changeset - 980691743559
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-07-24 12:41:55
madski@unity3d.com
pull requests: use name of branch of tip instead of tip - it is a confusing and moving target
1 file changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -107,11 +107,17 @@ class PullrequestsController(BaseRepoCon
 
                    peerbranches.add(abranch)
 

	
 
        selected = None
 
        tiprev = repo.tags.get('tip')
 
        tipbranch = None
 

	
 
        branches = []
 
        for abranch, branchrev in repo.branches.iteritems():
 
            n = 'branch:%s:%s' % (abranch, branchrev)
 
            branches.append((n, abranch))
 
            desc = abranch
 
            if branchrev == tiprev:
 
                tipbranch = abranch
 
                desc = '%s (tip)' % desc
 
            branches.append((n, desc))
 
            if rev == branchrev:
 
                selected = n
 
            if branch == abranch:
 
@@ -137,9 +143,11 @@ class PullrequestsController(BaseRepoCon
 

	
 
        tags = []
 
        for tag, tagrev in repo.tags.iteritems():
 
            if tag == 'tip':
 
                continue
 
            n = 'tag:%s:%s' % (tag, tagrev)
 
            tags.append((n, tag))
 
            if rev == tagrev and tag != 'tip':  # tip is not a real tag - and its branch is better
 
            if rev == tagrev:
 
                selected = n
 

	
 
        # prio 1: rev was selected as existing entry above
 
@@ -157,8 +165,8 @@ class PullrequestsController(BaseRepoCon
 
        # prio 4: tip revision
 
        if not selected:
 
            if h.is_hg(repo):
 
                if 'tip' in repo.tags:
 
                    selected = 'tag:tip:%s' % repo.tags['tip']
 
                if tipbranch:
 
                    selected = 'branch:%s:%s' % (tipbranch, tiprev)
 
                else:
 
                    selected = 'tag:null:0'
 
                    tags.append((selected, 'null'))
0 comments (0 inline, 0 general)