Changeset - 5fdad98e5b2e
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-07-18 18:44:54
madski@unity3d.com
pull requests: don't crash on empty hg repos without any tip
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -143,14 +143,18 @@ class PullrequestsController(BaseRepoCon
 
        if peers and not selected:
 
            selected = peers[0][0][0]
 

	
 
        # prio 4: tip revision
 
        if not selected:
 
            if h.is_hg(repo):
 
                if 'tip' in repo.tags:
 
                selected = 'tag:tip:%s' % repo.tags['tip']
 
            else:
 
                    selected = 'tag:null:0'
 
                    tags.append((selected, 'null'))
 
            else:
 
                if 'master' in repo.branches:
 
                    selected = 'branch:master:%s' % repo.branches['master']
 
                else:
 
                    k, v = repo.branches.items()[0]
 
                    selected = 'branch:%s:%s' % (k, v)
 

	
0 comments (0 inline, 0 general)