Attaching this time ...

On Tue, Aug 16, 2011 at 3:26 PM, Mark Phippard <markp...@gmail.com> wrote:

> On Tue, Aug 16, 2011 at 3:09 PM, Hyrum K Wright <hyrum.wri...@wandisco.com
> > wrote:
>
>> On Tue, Aug 16, 2011 at 11:59 AM, Mark Phippard <markp...@gmail.com>
>> wrote:
>> > The JavaHL propertySetRemote API seems incomplete.
>> > 1) It does not take a CommitMessageCallback.  So no way to provide
>> commit
>> > message.
>>
>>  r1158421 added the CommitMessageCallback to the propertSetRemote API.
>>
>> > 2) When trying to change a versioned property via URL, it fails with:
>> > Bogus revision information given
>> > svn: Setting property on non-local targets needs a base revision
>> > We want to use this API in Subclipse to freeze svn:externals properties
>> in a
>> > tag after committing it.  TortoiseSVN seems to offer to do this now.
>>
>> I'm not sure exactly what's going on here, or how to trigger it.  If
>> possible, a test case would go a long way toward illuminating this.
>>
>
> I have attached a patch that adds a new test that shows the problem. When
> this is working I would probably enhance the test to update the WC and
> verify the prop change.
>
> When I run the test with current trunk it fails with this:
>
> There was 1 error:
> 1)
> testPropEdit(org.apache.subversion.javahl.BasicTests)org.apache.subversion.javahl.ClientException:
> Bogus revision information given
> svn: Setting property on non-local targets needs a base revision
>
> at native.subversion.libsvn_client(prop_commands.c:418)
>  at org.apache.subversion.javahl.SVNClient.propertySetRemote(Native
> Method)
> at
> org.apache.subversion.javahl.BasicTests.testPropEdit(BasicTests.java:3146)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at org.apache.subversion.javahl.RunTests.main(RunTests.java:116)
>
> FAILURES!!!
> Tests run: 1,  Failures: 0,  Errors: 1
>
>
> --
> Thanks
>
> Mark Phippard
> http://markphip.blogspot.com/
>



-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/
Index: 
subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java
===================================================================
--- 
subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java   
    (revision 1158424)
+++ 
subversion/bindings/javahl/tests/org/apache/subversion/javahl/BasicTests.java   
    (working copy)
@@ -3110,6 +3110,46 @@
     }
 
     /**
+     * Test the basic SVNClient.propertySetRemote functionality.
+     * @throws Throwable
+     */
+    public void testPropEdit() throws Throwable
+    {
+       final String PROP = "abc";
+       final byte[] VALUE = new String("def").getBytes();
+       final byte[] NEWVALUE = new String("newvalue").getBytes();
+        // create the test working copy
+        OneTest thisTest = new OneTest();
+
+        Set<String> pathSet = new HashSet<String>();
+        // set a property on A/D/G/rho file
+        pathSet.clear();
+        pathSet.add(thisTest.getWCPath()+"/A/D/G/rho");
+        client.propertySetLocal(pathSet, PROP, VALUE,
+                                Depth.infinity, null, false);
+        thisTest.getWc().setItemPropStatus("A/D/G/rho", Status.Kind.modified);
+
+        // test the status of the working copy
+        thisTest.checkStatus();
+
+        // commit the changes
+        checkCommitRevision(thisTest, "wrong revision number from commit", 2,
+                            thisTest.getWCPathSet(), "log msg", Depth.infinity,
+                            false, false, null, null);
+
+        thisTest.getWc().setItemPropStatus("A/D/G/rho", Status.Kind.normal);
+
+        // check the status of the working copy
+        thisTest.checkStatus();
+        
+        // now edit the propval directly in the repository
+        client.propertySetRemote(thisTest.getUrl()+"/A/D/G/rho", PROP, 
NEWVALUE, new ConstMsg("edit prop"),
+                                 false, null, null);
+        
+
+    }
+
+    /**
      * Test tolerance of unversioned obstructions when adding paths with
      * {@link org.apache.subversion.javahl.SVNClient#checkout()},
      * {@link org.apache.subversion.javahl.SVNClient#update()}, and

Reply via email to