# HG changeset patch # User Martin Geisler # Date 1288358721 -7200 # Node ID 1634287b6ab1d1cd99b0d96fe36ef0d8b1e3bfa9 # Parent 551aa6e279291c59df5e0c39351962c1e30a0087 qnew: give better feedback when doing 'hg qnew foo/' (issue2464) diff -r 551aa6e27929 -r 1634287b6ab1 hgext/mq.py --- a/hgext/mq.py Fri Oct 29 12:50:08 2010 +0200 +++ b/hgext/mq.py Fri Oct 29 15:25:21 2010 +0200 @@ -839,8 +839,12 @@ insert = self.full_series_end() wlock = repo.wlock() try: - # if patch file write fails, abort early - p = self.opener(patchfn, "w") + try: + # if patch file write fails, abort early + p = self.opener(patchfn, "w") + except IOError, e: + raise util.Abort(_('cannot write patch "%s": %s') + % (patchfn, e.strerror)) try: if self.plainmode: if user: diff -r 551aa6e27929 -r 1634287b6ab1 tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t Fri Oct 29 12:50:08 2010 +0200 +++ b/tests/test-mq-qnew.t Fri Oct 29 15:25:21 2010 +0200 @@ -23,6 +23,7 @@ > hg qinit -c > > echo '% qnew with name containing slash' + > hg qnew foo/ > hg qnew foo/bar.patch > hg qseries > hg qpop @@ -105,6 +106,7 @@ abort: "foo#bar" cannot be used as the name of a patch abort: "foo:bar" cannot be used as the name of a patch % qnew with name containing slash + abort: cannot write patch "foo/": Is a directory foo/bar.patch popping foo/bar.patch patch queue now empty @@ -168,6 +170,7 @@ abort: "foo#bar" cannot be used as the name of a patch abort: "foo:bar" cannot be used as the name of a patch % qnew with name containing slash + abort: cannot write patch "foo/": Is a directory foo/bar.patch popping foo/bar.patch patch queue now empty