# HG changeset patch # User Mads Kiilerich # Date 2012-01-11 01:29:55 # Node ID 02b1355587563205eb92d0a13a137345db460f9f # Parent 710e6bf15538c4f44001060da39a91f42a71ec45 mq: make qsave implementation more explicit It wasn't obvious from the code how qsave mocked around with .hg/patches and .hg/patches.? and what was going on. This makes it more explicit so it will survive future refactorings. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2652,7 +2652,7 @@ def save(ui, repo, **opts): ret = q.save(repo, msg=message) if ret: return ret - q.savedirty() + q.savedirty() # save to .hg/patches before copying if opts.get('copy'): path = q.path if opts.get('name'): @@ -2669,10 +2669,9 @@ def save(ui, repo, **opts): ui.warn(_("copy %s to %s\n") % (path, newpath)) util.copyfiles(path, newpath) if opts.get('empty'): - try: - os.unlink(q.join(q.statuspath)) - except: - pass + del q.applied[:] + q.applieddirty = True + q.savedirty() return 0 @command("strip", diff --git a/tests/test-check-code-hg.t b/tests/test-check-code-hg.t --- a/tests/test-check-code-hg.t +++ b/tests/test-check-code-hg.t @@ -245,7 +245,6 @@ hgext/mq.py:0: > except: warning: naked except clause - warning: naked except clause hgext/mq.py:0: > ui.write("mq: %s\n" % ', '.join(m)) warning: unwrapped ui message