92 # wrap commit status use the topic branch heads |
93 # wrap commit status use the topic branch heads |
93 ctx = repo[node] |
94 ctx = repo[node] |
94 if ctx.topic() and ctx.branch() == branch: |
95 if ctx.topic() and ctx.branch() == branch: |
95 subbranch = "%s:%s" % (branch, ctx.topic()) |
96 subbranch = "%s:%s" % (branch, ctx.topic()) |
96 bheads = repo.branchheads("%s:%s" % (subbranch, ctx.topic())) |
97 bheads = repo.branchheads("%s:%s" % (subbranch, ctx.topic())) |
97 return orig(repo, node, branch, bheads=bheads, opts=opts) |
98 |
|
99 ret = orig(repo, node, branch, bheads=bheads, opts=opts) |
|
100 |
|
101 # logic copy-pasted from cmdutil.commitstatus() |
|
102 if opts is None: |
|
103 opts = {} |
|
104 ctx = repo[node] |
|
105 if ctx.topic(): |
|
106 return ret |
|
107 parents = ctx.parents() |
|
108 |
|
109 if (not opts.get('amend') and bheads and node not in bheads and not |
|
110 [x for x in parents if x.node() in bheads and x.branch() == branch]): |
|
111 repo.ui.status(_("(consider using topic for lightweight branches." |
|
112 " See 'hg help topic')\n")) |
|
113 |
|
114 return ret |
98 |
115 |
99 def _wrapbmcache(ui): |
116 def _wrapbmcache(ui): |
100 class topiccache(_topiccache, branchmap.branchcache): |
117 class topiccache(_topiccache, branchmap.branchcache): |
101 pass |
118 pass |
102 branchmap.branchcache = topiccache |
119 branchmap.branchcache = topiccache |