Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 26489:2a3fc0272e3f
localrepo: add a way to get the current wlock if it's held
This will be useful to pass around a reference to the lock to some functions
we're going to add to scmutil. We don't want those functions to live in
localrepo to avoid bloat.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Mon, 05 Oct 2015 14:27:37 -0700 |
parents | df2dc5141721 |
children | e72b62b154b0 |
comparison
equal
deleted
inserted
replaced
26488:df2dc5141721 | 26489:2a3fc0272e3f |
---|---|
1307 l = lockref() | 1307 l = lockref() |
1308 if l is None or not l.held: | 1308 if l is None or not l.held: |
1309 return None | 1309 return None |
1310 return l | 1310 return l |
1311 | 1311 |
1312 def currentwlock(self): | |
1313 """Returns the wlock if it's held, or None if it's not.""" | |
1314 return self._currentlock(self._wlockref) | |
1315 | |
1312 def _filecommit(self, fctx, manifest1, manifest2, linkrev, tr, changelist): | 1316 def _filecommit(self, fctx, manifest1, manifest2, linkrev, tr, changelist): |
1313 """ | 1317 """ |
1314 commit an individual file as part of a larger transaction | 1318 commit an individual file as part of a larger transaction |
1315 """ | 1319 """ |
1316 | 1320 |