Rev 393: Support special characters in filenames in working trees. in http://people.samba.org/bzr/jelmer/bzr-svn/bzr.dev
Jelmer Vernooij
jelmer at samba.org
Wed Jan 10 01:51:14 GMT 2007
------------------------------------------------------------
revno: 393
revision-id: jelmer at samba.org-20070110015047-2it8mj9d7bclg2ju
parent: jelmer at samba.org-20070109055935-s7gvlge0suagjkee
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: main
timestamp: Wed 2007-01-10 02:50:47 +0100
message:
Support special characters in filenames in working trees.
modified:
NEWS news-20061231030336-h9fhq245ie0de8bs-1
checkout.py workingtree.py-20060306120941-b083cb0fdd4a69de
tests/test_workingtree.py test_workingtree.py-20060622191524-0di7bc3q1ckdbybb-1
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
=== modified file 'NEWS'
--- a/NEWS 2007-01-08 17:39:06 +0000
+++ b/NEWS 2007-01-10 01:50:47 +0000
@@ -34,6 +34,8 @@
* Store file id map when committing to Subversion. (#54738)
+ * Support spaces in filenames in working trees.
+
IMPROVEMENTS
* Implemented SvnRepository.all_revision_ids().
=== modified file 'checkout.py'
--- a/checkout.py 2007-01-08 17:39:06 +0000
+++ b/checkout.py 2007-01-10 01:50:47 +0000
@@ -40,6 +40,7 @@
from copy import copy
import os
+import urllib
import svn.core, svn.wc
from svn.core import SubversionException, Pool
@@ -255,7 +256,7 @@
svn.wc.adm_close(wc)
def find_ids(entry, rootwc):
- relpath = entry.url[len(entry.repos):].strip("/")
+ relpath = urllib.unquote(entry.url[len(entry.repos):].strip("/"))
assert entry.schedule in (svn.wc.schedule_normal,
svn.wc.schedule_delete,
svn.wc.schedule_add,
=== modified file 'tests/test_workingtree.py'
--- a/tests/test_workingtree.py 2007-01-09 05:59:35 +0000
+++ b/tests/test_workingtree.py 2007-01-10 01:50:47 +0000
@@ -433,3 +433,13 @@
tree = WorkingTree.open("dc")
self.assertEqual(None, tree.inventory.path2id("file"))
self.assertEqual("fooid", tree.inventory.path2id("dir/file"))
+
+ def test_escaped_char_filename(self):
+ self.make_client('a', 'dc')
+ self.build_tree({'dc/file with spaces': 'data'})
+ tree = WorkingTree.open("dc")
+ tree.add(["file with spaces"], ["fooid"])
+ tree.commit("msg")
+ self.assertEqual("fooid", tree.inventory.path2id("file with spaces"))
+
+
=== modified file 'tree.py'
--- a/tree.py 2007-01-08 04:45:56 +0000
+++ b/tree.py 2007-01-10 01:50:47 +0000
@@ -30,6 +30,7 @@
import os
import md5
from cStringIO import StringIO
+import urllib
import svn.core, svn.wc, svn.delta, svn.ra
from svn.core import SubversionException, Pool
@@ -223,7 +224,7 @@
return ie
def find_ids(entry):
- relpath = entry.url[len(entry.repos):].strip("/")
+ relpath = urllib.unquote(entry.url[len(entry.repos):].strip("/"))
if entry.schedule in (svn.wc.schedule_normal,
svn.wc.schedule_delete,
svn.wc.schedule_replace):
More information about the bazaar-commits
mailing list