Mercurial > hg
changeset 8112:6ee71f78497c
switch lock releasing in the extensions from gc to explicit
author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> |
---|---|
date | Wed, 22 Apr 2009 02:01:22 +0200 |
parents | dbf20df40eb1 |
children | 87a1605979e4 |
files | hgext/convert/hg.py hgext/fetch.py hgext/keyword.py hgext/mq.py hgext/rebase.py hgext/transplant.py |
diffstat | 6 files changed, 22 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/convert/hg.py Wed Apr 22 02:01:22 2009 +0200 +++ b/hgext/convert/hg.py Wed Apr 22 02:01:22 2009 +0200 @@ -56,8 +56,8 @@ def after(self): self.ui.debug(_('run hg sink post-conversion action\n')) - self.lock = None - self.wlock = None + self.lock.release() + self.wlock.release() def revmapfile(self): return os.path.join(self.path, ".hg", "shamap")
--- a/hgext/fetch.py Wed Apr 22 02:01:22 2009 +0200 +++ b/hgext/fetch.py Wed Apr 22 02:01:22 2009 +0200 @@ -9,6 +9,7 @@ from mercurial.i18n import _ from mercurial.node import nullid, short from mercurial import commands, cmdutil, hg, util, url +from mercurial.lock import release def fetch(ui, repo, source='default', **opts): '''pull changes from a remote repository, merge new changes if needed. @@ -132,7 +133,7 @@ short(n))) finally: - del lock, wlock + release(lock, wlock) cmdtable = { 'fetch':
--- a/hgext/keyword.py Wed Apr 22 02:01:22 2009 +0200 +++ b/hgext/keyword.py Wed Apr 22 02:01:22 2009 +0200 @@ -83,6 +83,7 @@ from mercurial import commands, cmdutil, dispatch, filelog, revlog, extensions from mercurial import patch, localrepo, templater, templatefilters, util from mercurial.hgweb import webcommands +from mercurial.lock import release from mercurial.node import nullid, hex from mercurial.i18n import _ import re, shutil, tempfile, time @@ -273,8 +274,7 @@ lock = repo.lock() kwt.overwrite(None, expand, status[6]) finally: - del wlock, lock - + release(lock, wlock) def demo(ui, repo, *args, **opts): '''print [keywordmaps] configuration and an expansion example @@ -487,7 +487,7 @@ repo.hook('commit', node=n, parent1=_p1, parent2=_p2) return n finally: - del wlock, lock + release(lock, wlock) # monkeypatches def kwpatchfile_init(orig, self, ui, fname, opener, missing=False):
--- a/hgext/mq.py Wed Apr 22 02:01:22 2009 +0200 +++ b/hgext/mq.py Wed Apr 22 02:01:22 2009 +0200 @@ -31,6 +31,7 @@ from mercurial.i18n import _ from mercurial.node import bin, hex, short, nullid, nullrev +from mercurial.lock import release from mercurial import commands, cmdutil, hg, patch, util from mercurial import repair, extensions, url, error import os, sys, re, errno @@ -518,7 +519,8 @@ repo.dirstate.invalidate() raise finally: - del tr, lock, wlock + del tr + release(lock, wlock) self.removeundo(repo) def _apply(self, repo, series, list=False, update_status=True, @@ -766,6 +768,7 @@ for chunk in chunks: p.write(chunk) p.close() + wlock.release() wlock = None r = self.qrepo() if r: r.add([patchfn]) @@ -781,7 +784,7 @@ raise self.removeundo(repo) finally: - del wlock + release(wlock) def strip(self, repo, rev, update=True, backup="all", force=None): wlock = lock = None @@ -801,7 +804,7 @@ # the actual strip self.removeundo(repo) finally: - del lock, wlock + release(lock, wlock) def isapplied(self, patch): """returns (index, rev, patch)""" @@ -968,7 +971,7 @@ self.ui.write(_("now at: %s\n") % top) return ret[0] finally: - del wlock + wlock.release() def pop(self, repo, patch=None, force=False, update=True, all=False): def getfile(f, rev, flags): @@ -1070,7 +1073,7 @@ else: self.ui.write(_("patch queue now empty\n")) finally: - del wlock + wlock.release() def diff(self, repo, pats, opts): top = self.check_toppatch(repo) @@ -1295,7 +1298,7 @@ self.pop(repo, force=True) self.push(repo, force=True) finally: - del wlock + wlock.release() self.removeundo(repo) def init(self, repo, create=False): @@ -2179,7 +2182,7 @@ r.copy(patch, name) r.remove([patch], False) finally: - del wlock + wlock.release() q.save_dirty()
--- a/hgext/rebase.py Wed Apr 22 02:01:22 2009 +0200 +++ b/hgext/rebase.py Wed Apr 22 02:01:22 2009 +0200 @@ -18,6 +18,7 @@ from mercurial import extensions, ancestor, copies, patch from mercurial.commands import templateopts from mercurial.node import nullrev +from mercurial.lock import release from mercurial.i18n import _ import os, errno @@ -141,7 +142,7 @@ if skipped: ui.note(_("%d revisions have been skipped\n") % len(skipped)) finally: - del lock, wlock + release(lock, wlock) def concludenode(repo, rev, p1, p2, state, collapse, last=False, skipped={}, extrafn=None):
--- a/hgext/transplant.py Wed Apr 22 02:01:22 2009 +0200 +++ b/hgext/transplant.py Wed Apr 22 02:01:22 2009 +0200 @@ -168,7 +168,8 @@ finally: self.saveseries(revmap, merges) self.transplants.write() - del lock, wlock + lock.release() + wlock.release() def filter(self, filter, changelog, patchfile): '''arbitrarily rewrite changeset before applying it''' @@ -293,7 +294,7 @@ return n, node finally: - del wlock + wlock.release() def readseries(self): nodes = []