Commits

Anonymous committed 0f98f25

[states] use ``self`` instead of ``repo`` in ``statefulrepo``

Comments (0)

Files changed (1)

             enabled =  self._enabledstates
             # look up for lower state that is enabled
             prev = max(st for st in STATES if st < state and st in enabled)
-            if repo.stateheads(state) != repo.stateheads(prev):
+            if self.stateheads(state) != self.stateheads(prev):
                 raise error.Abort(
                     _('%s could not be disabled: not empty' % state.name),
                     hint=_("You may want to use `hg %s '%sheads()'`"
                     continue
                 olds = heads[:]
                 rst = "heads((::%s()) - (%s))" % (st.headssymbol, req_nodes_rst)
-                heads[:] = noderange(repo, [rst])
+                heads[:] = noderange(self, [rst])
                 if olds != heads:
                     _writestateshead(self)
             #modify the state
             if state in self._statesheads:
-                revs = scmutil.revrange(repo, changesets)
-                repo.setstate(state, [repo.changelog.node(rev) for rev in revs])
+                revs = scmutil.revrange(self, changesets)
+                self.setstate(state, [self.changelog.node(rev) for rev in revs])
 
         def setstate(self, state, nodes):
             """change state of targets changeset and it's ancestors.
             heads[:] = set(heads)
             heads.sort()
             if olds != heads:
-                heads[:] = noderange(repo, ["heads(::%s())" % state.headssymbol])
+                heads[:] = noderange(self, ["heads(::%s())" % state.headssymbol])
                 heads.sort()
             if olds != heads:
                 _writestateshead(self)
                 h = missing.pop()
                 ok = remote.pushkey('states-heads', node.hex(h), '', state.name)
                 if not ok:
-                    missing.update(p.node() for p in repo[h].parents())
+                    missing.update(p.node() for p in self[h].parents())
 
 
         def _pullstatesheads(self, remote):