[Bug 4711] New: MQ allows patch name with newline, but doesn't handle it well.

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Jun 3 23:46:42 CDT 2015


http://bz.selenic.com/show_bug.cgi?id=4711

          Priority: normal
            Bug ID: 4711
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: MQ allows patch name with newline, but doesn't handle
                    it well.
          Severity: bug
    Classification: Unclassified
                OS: Windows
          Reporter: jwdevel at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 3.4-rc
         Component: mq
           Product: Mercurial

You can create a patch with a name containing newlines:

  $ hg qnew 'my
  patch
  name'

but later on, you will get weird messages:

  $ hg qa
  malformated mq status line: ['patch']
  malformated mq status line: ['name']
  my

  $ hg qu
  malformated mq status line: ['patch']
  malformated mq status line: ['name']
  patch
  name

  $ cat .hg/patches/status
  5230181663c53549847d608f4c858405ead07cba:p1
  daf1dc50835c06de5f64b93610ce1d6e686a4bbf:my
  patch
  name

Other commands, like 'qdelete', etc. will have problems, too.

I imagine that newlines (and perhaps all non-printing characters?) should be
added to the excluded characters in mq.py -- see checkreservedname().

Maybe checkreservedname should use a whitelist, rather than a blacklist? It
might be tricky to allow fancy unicode in patch names under such a scheme,
though. I can imagine some users enjoying the fact that unicode is allowed,
currently -- I just created a patch named "¾" to test, and there were no
problems.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list