# HG changeset patch # User Mads Kiilerich # Date 1326245395 -3600 # 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 -r 710e6bf15538 -r 02b135558756 hgext/mq.py --- a/hgext/mq.py Wed Jan 11 02:28:36 2012 +0100 +++ b/hgext/mq.py Wed Jan 11 02:29:55 2012 +0100 @@ -2652,7 +2652,7 @@ 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 @@ 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 -r 710e6bf15538 -r 02b135558756 tests/test-check-code-hg.t --- a/tests/test-check-code-hg.t Wed Jan 11 02:28:36 2012 +0100 +++ b/tests/test-check-code-hg.t Wed Jan 11 02:29:55 2012 +0100 @@ -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