hgext/states.py
changeset 101 21dbec91e775
parent 100 7d0617e584ff
child 102 5111329280f1
equal deleted inserted replaced
100:7d0617e584ff 101:21dbec91e775
  1053             state = repo.nodestate(nd)
  1053             state = repo.nodestate(nd)
  1054             if state.trackheads:
  1054             if state.trackheads:
  1055                 statesheads.setdefault(state, set([])).add(nd)
  1055                 statesheads.setdefault(state, set([])).add(nd)
  1056 
  1056 
  1057         for state, heads in repo._statesheads.iteritems():
  1057         for state, heads in repo._statesheads.iteritems():
  1058             if state.trackheads:
  1058             if not state.trackheads:
  1059                 heads = set(heads) - tostrip | statesheads.get(state, set([]))
  1059                 continue
  1060                 repo._statesheads[state] = list(heads)
  1060             heads = set(heads) - tostrip | statesheads.get(state, set([]))
       
  1061             # reduce heads (make them really heads)
       
  1062             revs = set(map(cl.rev, heads))
       
  1063             minrev = min(revs)
       
  1064             for rev in cl.ancestors(*revs):
       
  1065                 if rev >= minrev:
       
  1066                     revs.discard(rev)
       
  1067             repo._statesheads[state] = map(cl.node, revs)
  1061         _writestateshead(repo)
  1068         _writestateshead(repo)
  1062 
  1069 
  1063         return ostrip(ui, repo, node, backup)
  1070         return ostrip(ui, repo, node, backup)
  1064 
  1071 
  1065     mercurial.repair.strip = strip
  1072     mercurial.repair.strip = strip