comparison hgext3rd/topic/destination.py @ 5024:b1a9d548af52 stable

evolve: fix a bug in logic of choosing destination for hg update
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Fri, 20 Dec 2019 17:31:57 +0530
parents 48b30ff742cb
children e7949274c3f9
comparison
equal deleted inserted replaced
5023:abefd37c6afa 5024:b1a9d548af52
64 """decide on an update destination from current topic""" 64 """decide on an update destination from current topic"""
65 if not common.hastopicext(repo): 65 if not common.hastopicext(repo):
66 return None, None, None 66 return None, None, None
67 movemark = node = None 67 movemark = node = None
68 topic = repo.currenttopic 68 topic = repo.currenttopic
69 revs = []
69 if topic: 70 if topic:
70 revs = repo.revs(b'.::topic(%s)', topic) 71 revs = repo.revs(b'.::topic(%s)', topic)
71 else: 72 else:
72 revs = []
73 if not revs:
74 return None, None, None 73 return None, None, None
75 node = revs.last() 74 if revs:
75 node = revs.last()
76 else:
77 node = repo[b'.'].node()
76 if bookmarks.isactivewdirparent(repo): 78 if bookmarks.isactivewdirparent(repo):
77 movemark = repo[b'.'].node() 79 movemark = repo[b'.'].node()
78 return node, movemark, None 80 return node, movemark, None
79 81
80 def desthistedit(orig, ui, repo): 82 def desthistedit(orig, ui, repo):