Mercurial > evolve
comparison hgext3rd/topic/stack.py @ 2839:f9c8c754a528
context: troubled was deprecated
Use isunstable instead.
Match 52c5ff856b49ac8f2a4eadda6dc9dbb070f39a3f mercurial changeset.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 11 Aug 2017 09:32:23 +0200 |
parents | 1c9150e30b28 |
children | 9897babc1fb5 |
comparison
equal
deleted
inserted
replaced
2838:1c9150e30b28 | 2839:f9c8c754a528 |
---|---|
16 | 16 |
17 # TODO: compat | 17 # TODO: compat |
18 | 18 |
19 if not util.safehasattr(context.basectx, 'orphan'): | 19 if not util.safehasattr(context.basectx, 'orphan'): |
20 context.basectx.orphan = context.basectx.unstable | 20 context.basectx.orphan = context.basectx.unstable |
21 | |
22 if not util.safehasattr(context.basectx, 'isunstable'): | |
23 context.basectx.isunstable = context.basectx.troubled | |
21 | 24 |
22 def getstack(repo, branch=None, topic=None): | 25 def getstack(repo, branch=None, topic=None): |
23 # XXX need sorting | 26 # XXX need sorting |
24 if topic is not None and branch is not None: | 27 if topic is not None and branch is not None: |
25 raise error.ProgrammingError('both branch and topic specified (not defined yet)') | 28 raise error.ProgrammingError('both branch and topic specified (not defined yet)') |
176 :behindcount: number of changeset on rebase destination | 179 :behindcount: number of changeset on rebase destination |
177 """ | 180 """ |
178 data = {} | 181 data = {} |
179 revs = getstack(repo, branch, topic)[1:] | 182 revs = getstack(repo, branch, topic)[1:] |
180 data['changesetcount'] = len(revs) | 183 data['changesetcount'] = len(revs) |
181 data['troubledcount'] = len([r for r in revs if repo[r].troubled()]) | 184 data['troubledcount'] = len([r for r in revs if repo[r].isunstable()]) |
182 deps, rdeps = builddependencies(repo, revs) | 185 deps, rdeps = builddependencies(repo, revs) |
183 data['headcount'] = len([r for r in revs if not rdeps[r]]) | 186 data['headcount'] = len([r for r in revs if not rdeps[r]]) |
184 data['behindcount'] = 0 | 187 data['behindcount'] = 0 |
185 if revs: | 188 if revs: |
186 minroot = [min(r for r in revs if not deps[r])] | 189 minroot = [min(r for r in revs if not deps[r])] |