Mercurial > public > mercurial-scm > hg
comparison mercurial/hbisect.py @ 30065:ee21ed7fc7a2
bisect: extract the 'reset' logic into its own function
This is part of small clean up movement. The bisect module seem more appropriate
to host the bisect logic. The cleanup itself is motivated by some higher level
cleanup around vfs and locking.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 24 Aug 2016 04:13:53 +0200 |
parents | 9b8a5c6ac176 |
children | 5f93737d0ba8 |
comparison
equal
deleted
inserted
replaced
30064:b24804f72116 | 30065:ee21ed7fc7a2 |
---|---|
156 with repo.wlock(): | 156 with repo.wlock(): |
157 for kind in sorted(state): | 157 for kind in sorted(state): |
158 for node in state[kind]: | 158 for node in state[kind]: |
159 f.write("%s %s\n" % (kind, hex(node))) | 159 f.write("%s %s\n" % (kind, hex(node))) |
160 f.close() | 160 f.close() |
161 | |
162 def resetstate(repo): | |
163 """remove any bisect state from the repository""" | |
164 if repo.vfs.exists("bisect.state"): | |
165 repo.vfs.unlink("bisect.state") | |
161 | 166 |
162 def get(repo, status): | 167 def get(repo, status): |
163 """ | 168 """ |
164 Return a list of revision(s) that match the given status: | 169 Return a list of revision(s) that match the given status: |
165 | 170 |