Changeset - 7c917e15c045
[Not reviewed]
default
0 1 0
Mads Kiilerich - 9 years ago 2016-09-06 00:51:18
madski@unity3d.com
pullrequests: when creating, don't convert selected revision to tag name

It kind of makes sense that if a branch head or bookmarked revision is chosen,
then pretend the symbolic name was chosen. The name can move and will give the
PR a future. That is currently done both when populating the select boxes and
when actually creating the new PR. There, a selected revision is also
"upgraded" to its branch.

Tags are however mostly static. Fair enough if a user wants to create a PR from
a tag, but if a revision is selected, it shouldn't be side tracked to the tag name.
1 file changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -130,26 +130,25 @@ class PullrequestsController(BaseRepoCon
 
        for bookmark, bookmarkrev in repo.bookmarks.iteritems():
 
            n = 'book:%s:%s' % (bookmark, bookmarkrev)
 
            bookmarks.append((n, bookmark))
 
            if rev == bookmarkrev:
 
                selected = n
 

	
 
        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:
 
                selected = n
 
            # note: even if rev == tagrev, don't select the static tag - it must be chosen explicitly
 

	
 
        # prio 1: rev was selected as existing entry above
 

	
 
        # prio 2: create special entry for rev; rev _must_ be used
 
        specials = []
 
        if rev and selected is None:
 
            selected = 'rev:%s:%s' % (rev, rev)
 
            specials = [(selected, '%s: %s' % (_("Changeset"), rev[:12]))]
 

	
 
        # prio 3: most recent peer branch
 
        if peers and not selected:
 
            selected = peers[0][0]
0 comments (0 inline, 0 general)