Svn revert a single property on a directory

propertiessvn

How can I revert one of several properties on a directory from svn command line?

My svn trunk has a property svn:externals to import an external repo.

/trunk
  svn:external = /external/trunk

When I set up a new branch foo, the external is changed to point to a branch as well:

/branches/foo
  svn:external = /external/branches/foo

Sometimes when I merge a branch back into the trunk, that property gets copied over and I end up with:

/trunk
  svn:external = /external/branches/foo

Normally I could run svn revert . --depth=empty to undo the property merge, but there are other properties on the dir that would be reverted as well, specifically svn:mergeinfo. From my GUI client I can revert individual properties pretty easily, but I don't always remember to do so. Is there a way to do the same thing directly from svn cmd line, or do I need to write some crazy wrapper for svn propget to get and undo the diff?

Best Answer

svn propset svn:externals "$(svn propget svn:externals . -r HEAD)" .

this sets the property to the HEAD value. This is a valid workaround since revert can only be applied to all properties, and doesn't exist for individual properties.

Related Question