Merge lp:~rosslagerwall/bzr/cmdline-empty-quotes into lp:bzr

Proposed by Ross Lagerwall
Status: Merged
Merged at revision: 6578
Proposed branch: lp:~rosslagerwall/bzr/cmdline-empty-quotes
Merge into: lp:bzr
Diff against target: 26 lines (+5/-0)
2 files modified
bzrlib/ (+1/-0)
bzrlib/tests/ (+4/-0)
To merge this branch: bzr merge lp:~rosslagerwall/bzr/cmdline-empty-quotes
Reviewer Review Type Date Requested Status
Richard Wilbur Approve
Review via email:

Description of the change

This branch fixes up parsing of command lines like EDITOR='emacsclient -a "" -t' which are currently handled incorrectly.

To post a comment you must log in.
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Looks good. Is this written up as a bug? If so please add a reference to the bug number.

review: Approve
Revision history for this message
Ross Lagerwall (rosslagerwall) wrote :

No, I didn't open a bug for it (I haven't searched for one though).

Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

I looked for bugs with "empty string", "empty quotes" and didn't find this problem. Would you like to open a bug for it? I don't know your context in order to fill in the bug info.

Revision history for this message
Ross Lagerwall (rosslagerwall) wrote :

Ok, I wrote a bug and linked it to this branch.

Revision history for this message
Vincent Ladeuil (vila) wrote :

Landing with an added news entry on both 2.5 and trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/'
2--- bzrlib/ 2011-12-19 13:23:58 +0000
3+++ bzrlib/ 2012-12-10 14:57:21 +0000
4@@ -72,6 +72,7 @@
5 if next_char == u'\\':
6 return _Backslash(self)
7 elif next_char == self.quote_char:
8+ context.token.append(u'')
9 return self.exit_state
10 else:
11 context.token.append(next_char)
13=== modified file 'bzrlib/tests/'
14--- bzrlib/tests/ 2010-12-06 14:01:44 +0000
15+++ bzrlib/tests/ 2012-12-10 14:57:21 +0000
16@@ -66,6 +66,10 @@
17 self.assertAsTokens([(True, '')], u'""')
18 self.assertAsTokens([(False, u"''")], u"''")
19 self.assertAsTokens([(True, '')], u"''", single_quotes_allowed=True)
20+ self.assertAsTokens([(False, u'a'), (True, u''), (False, u'c')],
21+ u'a "" c')
22+ self.assertAsTokens([(False, u'a'), (True, u''), (False, u'c')],
23+ u"a '' c", single_quotes_allowed=True)
25 def test_unicode_chars(self):
26 self.assertAsTokens([(False, u'f\xb5\xee'), (False, u'\u1234\u3456')],