Mercurial > hg
changeset 8795:51c29aec0b75
mq: eliminate warning on qpush with empty series
Warning was "DeprecationWarning: use lock.release instead of del lock"
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Mon, 08 Jun 2009 20:02:44 +0200 |
parents | 1c610db4a897 |
children | 2bcef677a6c3 |
files | hgext/mq.py tests/test-mq-qpush-fail tests/test-mq-qpush-fail.out |
diffstat | 3 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py Sat May 23 20:38:08 2009 +0900 +++ b/hgext/mq.py Mon Jun 08 20:02:44 2009 +0200 @@ -902,14 +902,14 @@ def push(self, repo, patch=None, force=False, list=False, mergeq=None, all=False): wlock = repo.wlock() - if repo.dirstate.parents()[0] not in repo.heads(): - self.ui.status(_("(working directory not at a head)\n")) + try: + if repo.dirstate.parents()[0] not in repo.heads(): + self.ui.status(_("(working directory not at a head)\n")) - if not self.series: - self.ui.warn(_('no patches in series\n')) - return 0 + if not self.series: + self.ui.warn(_('no patches in series\n')) + return 0 - try: patch = self.lookup(patch) # Suppose our series file is: A B C and the current 'top' # patch is B. qpush C should be performed (moving forward)