Rev 2145: Fix removing file properties. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5

Jelmer Vernooij jelmer at samba.org
Wed Dec 3 19:30:10 GMT 2008


At http://people.samba.org/bzr/jelmer/bzr-svn/0.5

------------------------------------------------------------
revno: 2145
revision-id: jelmer at samba.org-20081203193007-s0lqpinsoxjohx8k
parent: jelmer at samba.org-20081203191218-n3spaugk52xeyfab
parent: jelmer at samba.org-20081203192916-e4neu5ew4znas7k8
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Wed 2008-12-03 20:30:07 +0100
message:
  Fix removing file properties. 
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  subvertpy/subvertpy/editor.c   editor.c-20080602191336-frj7az1sdk13o1tw-1
  subvertpy/subvertpy/tests/test_ra.py test_ra.py-20080313141743-uzsm7ejitrlqone5-1
  subvertpy/subvertpy/tests/test_server.py test_server.py-20081006150547-hj71pjqjdq4a89kf-1
    ------------------------------------------------------------
    revno: 1925.2.39
    revision-id: jelmer at samba.org-20081203192916-e4neu5ew4znas7k8
    parent: jelmer at samba.org-20081203015245-ori5q46wn3n4mpp8
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2008-12-03 20:29:16 +0100
    message:
      Fix removing file properties.
    modified:
      subvertpy/editor.c             editor.c-20080602191336-frj7az1sdk13o1tw-1
      subvertpy/tests/test_ra.py     test_ra.py-20080313141743-uzsm7ejitrlqone5-1
    ------------------------------------------------------------
    revno: 1925.2.38
    revision-id: jelmer at samba.org-20081203015245-ori5q46wn3n4mpp8
    parent: jelmer at samba.org-20081124164942-9wiz5pzx9997oi4y
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Wed 2008-12-03 02:52:45 +0100
    message:
      Fix import of SVNServer.
    modified:
      subvertpy/tests/test_server.py test_server.py-20081006150547-hj71pjqjdq4a89kf-1
    ------------------------------------------------------------
    revno: 1925.2.37
    revision-id: jelmer at samba.org-20081124164942-9wiz5pzx9997oi4y
    parent: jelmer at samba.org-20081118014852-adcll1vromj6ffr7
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Mon 2008-11-24 17:49:42 +0100
    message:
      Fix https.
    modified:
      subvertpy/ra.py                ra.py-20081116162923-6yq5jahxp5y23n5t-1
=== modified file 'NEWS'
--- a/NEWS	2008-12-01 15:45:44 +0000
+++ b/NEWS	2008-12-03 19:30:07 +0000
@@ -56,6 +56,8 @@
 
    * Correctly detect prefix when repository root is URL root (#303292)
 
+   * Fix removing file properties. (#304866)
+
   INTERNALS
 
    * Remove custom commit code for working tree. 

=== modified file 'subvertpy/subvertpy/editor.c'
--- a/subvertpy/subvertpy/editor.c	2008-11-18 01:54:17 +0000
+++ b/subvertpy/subvertpy/editor.c	2008-12-03 19:30:07 +0000
@@ -199,7 +199,7 @@
 	c_value.len = vallen;
 
 	RUN_SVN(editor->editor->change_file_prop(editor->baton, name, 
-				&c_value, editor->pool));
+				(c_value.data == NULL)?NULL:&c_value, editor->pool));
 	Py_RETURN_NONE;
 }
 
@@ -370,7 +370,7 @@
 	c_value.len = vallen;
 
 	RUN_SVN(editor->editor->change_dir_prop(editor->baton, name, 
-					&c_value, editor->pool));
+					(c_value.data == NULL)?NULL:&c_value, editor->pool));
 
 	Py_RETURN_NONE;
 }

=== modified file 'subvertpy/subvertpy/tests/test_ra.py'
--- a/subvertpy/subvertpy/tests/test_ra.py	2008-10-09 21:05:39 +0000
+++ b/subvertpy/subvertpy/tests/test_ra.py	2008-12-03 19:29:16 +0000
@@ -151,6 +151,25 @@
         subdir.close()
         dir.close()
         editor.close()
+
+    def test_commit_file_props(self):
+        cb = self.commit_editor()
+        f = cb.add_file("bar")
+        f.modify("a")
+        f.change_prop("bla:bar", "blie")
+        cb.close()
+
+        cb = self.commit_editor()
+        f = cb.open_file("bar")
+        f.change_prop("bla:bar", None)
+        cb.close()
+        
+        stream = StringIO()
+        props = self.ra.get_file("bar", stream, 1)[1]
+        self.assertEquals("blie", props.get("bla:bar"))
+        stream = StringIO()
+        props = self.ra.get_file("bar", stream, 2)[1]
+        self.assertIs(None, props.get("bla:bar"))
     
     def test_get_file_revs(self):
         cb = self.commit_editor()

=== modified file 'subvertpy/subvertpy/tests/test_server.py'
--- a/subvertpy/subvertpy/tests/test_server.py	2008-10-06 15:06:36 +0000
+++ b/subvertpy/subvertpy/tests/test_server.py	2008-12-03 01:52:45 +0000
@@ -15,6 +15,6 @@
 
 """Subversion server tests."""
 
-from subvertpy.server import SVNServer
+from subvertpy.ra_svn import SVNServer
 from subvertpy.tests import SubversionTestCase
 




More information about the bazaar-commits mailing list