Merge lp:~bialix/bzr/backslashes-more-tests into lp:bzr

Proposed by Alexander Belchenko
Status: Rejected
Rejected by: Robert Collins
Proposed branch: lp:~bialix/bzr/backslashes-more-tests
Merge into: lp:bzr
Diff against target: 72 lines (+42/-0)
2 files modified
NEWS (+4/-0)
bzrlib/tests/test_cmdline.py (+38/-0)
To merge this branch: bzr merge lp:~bialix/bzr/backslashes-more-tests
Reviewer Review Type Date Requested Status
Gordon Tyler Approve
Review via email: mp+25612@code.launchpad.net

Description of the change

This branches provides merge of latest changes in 2.1 to bzr.dev with resolved conflicts.

To post a comment you must log in.
Revision history for this message
Gordon Tyler (doxxx) wrote :

Looks good to me other than the duplication of BackslashDirSeparatorFeature, which also appears in test_win32utils, and the spurious(?) NEWS entry.

review: Approve
Revision history for this message
Robert Collins (lifeless) wrote :

We copy forward NEWS entries from old releases to trunk when merging
old releases to trunk, that way the trunk NEWS is accurate. So it
looks ok to me.

Revision history for this message
Robert Collins (lifeless) wrote :

I was merging 2.0 -> 2.1 -> trunk to get the pyrex fix, and ended up including the same change this had. I've moved rather than duplicating the feature though.

Revision history for this message
Alexander Belchenko (bialix) wrote :

Why you marked it as Rejected?

Revision history for this message
Robert Collins (lifeless) wrote :

because I'm landing the same change from a different branch where I
started from a newer 2.1 - I had conflicts trying to incorporate your
branch.

-Rob

Revision history for this message
Alexander Belchenko (bialix) wrote :

So, in the end my work by resolving merge conflicts was useless. Heh.

Revision history for this message
Robert Collins (lifeless) wrote :

Not useless at all - I looked at your diff as I did it to understand
how it should be resolved; it was just easier overall to do it
separately - because I had more in 2.1 than you'd resolved, bzr wasn't
picking a great ancestor.

-Rob

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-05-19 02:20:50 +0000
+++ NEWS 2010-05-19 14:37:32 +0000
@@ -639,6 +639,10 @@
639Bug Fixes639Bug Fixes
640*********640*********
641641
642* ``bzr clean-tree`` should not delete nested bzrdirs. Required for proper
643 support of bzr-externals and scmproj plugins.
644 (Alexander Belchenko, bug #572098)
645
642* ``bzr switch`` does not die if a ConfigurableFileMerger is used.646* ``bzr switch`` does not die if a ConfigurableFileMerger is used.
643 (Aaron Bentley, #559436)647 (Aaron Bentley, #559436)
644648
645649
=== modified file 'bzrlib/tests/test_cmdline.py'
--- bzrlib/tests/test_cmdline.py 2010-03-01 09:02:18 +0000
+++ bzrlib/tests/test_cmdline.py 2010-05-19 14:37:32 +0000
@@ -14,11 +14,29 @@
14# along with this program; if not, write to the Free Software14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA15# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1616
17import os
1718
18from bzrlib import (19from bzrlib import (
19 cmdline,20 cmdline,
20 tests)21 tests)
2122
23
24class _BackslashDirSeparatorFeature(tests.Feature):
25
26 def _probe(self):
27 try:
28 os.lstat(os.getcwd() + '\\')
29 except OSError:
30 return False
31 else:
32 return True
33
34 def feature_name(self):
35 return "Filesystem treats '\\' as a directory separator."
36
37BackslashDirSeparatorFeature = _BackslashDirSeparatorFeature()
38
39
22class TestSplitter(tests.TestCase):40class TestSplitter(tests.TestCase):
2341
24 def assertAsTokens(self, expected, line, single_quotes_allowed=False):42 def assertAsTokens(self, expected, line, single_quotes_allowed=False):
@@ -91,3 +109,23 @@
91 u'"x x" "y y"')109 u'"x x" "y y"')
92 self.assertAsTokens([(True, u'x x'), (True, u'y y')],110 self.assertAsTokens([(True, u'x x'), (True, u'y y')],
93 u'"x x" \'y y\'', single_quotes_allowed=True)111 u'"x x" \'y y\'', single_quotes_allowed=True)
112
113 def test_n_backslashes_handling(self):
114 # https://bugs.launchpad.net/bzr/+bug/528944
115 # actually we care about the doubled backslashes when they're
116 # represents UNC paths.
117 # But in fact there is too much weird corner cases
118 # (see https://bugs.launchpad.net/tortoisebzr/+bug/569050)
119 # so to reproduce every bit of windows command-line handling
120 # could be not worth of efforts?
121 self.requireFeature(BackslashDirSeparatorFeature)
122 self.assertAsTokens([(True, r'\\host\path')], r'"\\host\path"')
123 self.assertAsTokens([(False, r'\\host\path')], r'\\host\path')
124 # handling of " after the 2n and 2n+1 backslashes
125 # inside and outside the quoted string
126 self.assertAsTokens([(True, r'\\'), (False, r'*.py')], r'"\\\\" *.py')
127 self.assertAsTokens([(True, r'\\" *.py')], r'"\\\\\" *.py"')
128 self.assertAsTokens([(True, r'\\ *.py')], r'\\\\" *.py"')
129 self.assertAsTokens([(False, r'\\"'), (False, r'*.py')],
130 r'\\\\\" *.py')
131 self.assertAsTokens([(True, u'\\\\')], u'"\\\\')