# HG changeset patch # User Augie Fackler # Date 1433529298 14400 # Node ID b5a8bc09b0dbd91594d0713b61f82dd00f07af21 # Parent d3a00fc3680fbca6280712bc8b6dafb3c0be3bfd mq: ban \r and \n in patch names (issue4711) This is at best crazy, and at worst will break things like the series file. Let's just stop the madness. diff -r d3a00fc3680f -r b5a8bc09b0db hgext/mq.py --- a/hgext/mq.py Fri Jun 05 14:31:52 2015 -0400 +++ b/hgext/mq.py Fri Jun 05 14:34:58 2015 -0400 @@ -1102,7 +1102,7 @@ if name.startswith(prefix): raise util.Abort(_('patch name cannot begin with "%s"') % prefix) - for c in ('#', ':'): + for c in ('#', ':', '\r', '\n'): if c in name: raise util.Abort(_('%r cannot be used in the name of a patch') % c) diff -r d3a00fc3680f -r b5a8bc09b0db tests/test-mq-qnew.t --- a/tests/test-mq-qnew.t Fri Jun 05 14:31:52 2015 -0400 +++ b/tests/test-mq-qnew.t Fri Jun 05 14:34:58 2015 -0400 @@ -21,6 +21,7 @@ > hg qnew .mqfoo > hg qnew 'foo#bar' > hg qnew 'foo:bar' + > hg qnew "`echo foo; echo bar`" > > hg qinit -c > @@ -110,6 +111,7 @@ abort: patch name cannot begin with ".mq" abort: '#' cannot be used in the name of a patch abort: ':' cannot be used in the name of a patch + abort: '\n' cannot be used in the name of a patch % qnew with name containing slash abort: path ends in directory separator: foo/ (glob) abort: "foo" already exists as a directory @@ -178,6 +180,7 @@ abort: patch name cannot begin with ".mq" abort: '#' cannot be used in the name of a patch abort: ':' cannot be used in the name of a patch + abort: '\n' cannot be used in the name of a patch % qnew with name containing slash abort: path ends in directory separator: foo/ (glob) abort: "foo" already exists as a directory