[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Username Change in SVN

From: Ryan Schmidt <subversion-2008b_at_ryandesign.com>
Date: Fri, 27 Jun 2008 16:10:05 -0500

By default, you are not allowed to change revision properties. This
is because a repository is designed to never lose your data, but
revision properties are not versioned, so if you were to change a
revision property, the old value would be lost forever. Also, there
are implications for backups, since if you allow changing revision
properties, old history changes and your backup strategy needs to
handle re-backing up those files. If you are using svnsync to sync
this repository to another, then you need to anticipate this issue
there as well, to re-sync a revision (or at least its properties)
when the properties are changed.

If you want to allow changing revision properties, you have to write
a pre-revprop-change hook script allowing it. The pre-revprop-
change.tmpl file in the hooks directory in your repository is just a
template, an example. To use it, copy it to pre-revprop-change (with
no extension) and give it the executable bit. Also you'll have to
modify the script; the example script only allows you to change a
revision's log message, not its author.

On Jun 27, 2008, at 09:38, Dzintars Brikis wrote:

> Ok - now I understand the thing about changing (at least for
> getting info I am sure that I know how - its working), BUT
> with the propset command I am not so successfull, because I am
> getting such error:
> ----------------------------------
> svn: DAV request failed; it's possible that the repository's pre-
> revprop-change hook either failed or is non-existent
> svn: At least one property change failed; repository is unchanged
> ----------------------------------
> So what I am missing or what I have to do additional to get this
> command working ?
> At least I have pre-revprop-change.tmpl file in hook folder, but I
> dont understand - is this just a template and should be renamed/
> replaced or some additional changes must be done so that this
> script starts to work.
>
> Dzintars
>
> Ryan Schmidt wrote:
>
>> On Jun 27, 2008, at 01:29, Dzintars Brikis wrote:
>>
>>> 1. Ok, then if I change username for whole revision - how I
>>> check what is the author for revision?
>>
>>
>> svn propget --revprop -r $REV svn:author $REPO
>>
>> where $REV is the revision number you want to know the author of,
>> and $REPO is the URL of your repository.
>>
>>> 2. And "path to the repository" - this is the local path to the
>>> SVN repository after I have check-outed it ? ... and after that
>>> should I commit it again ?
>>
>>
>> "path_to_repository" should have been "url_to_repository". The
>> correct command to set the author is:
>>
>> svn propset --revprop -r $REV svn:author $AUTHOR $REPO
>>
>> where $REV is the revision number you want to set the author of,
>> $AUTHOR is the string you want to set the author property to, and
>> $REPO is the URL of your repository.
>>
>> You can also see "svn help propget" and "svn help propset", and
>> of course the free book available at http://svnbook.org/
>>
>>
>>> Paul Koning wrote:
>>>
>>>>>>>>> "Dzintars" == Dzintars Brikis <dzintars.brikis_at_mebius.lv>
>>>>>>>>> writes:
>>>>>>>>>
>>>>
>>>> Dzintars> 1. how to check author for specific file for all
>>>> revisions.
>>>>
>>>> svn log <filename> will do that.
>>>>
>>>> Dzintars> 2. how to change author for specific file for all
>>>> revisions
>>>> Dzintars> or at least one revision.
>>>>
>>>> Author is a property of a revision, NOT of a file. You can't
>>>> change
>>>> author for just one of the files changed by the revision; if you
>>>> change author that changes the whole revision.
>>>>
>>>> svn propset -revprop -r <rev> svn:author <newauthor>
>>>> <path_to_repository>
>>>>
>>>> Because a revprop change works on the whole revision, all you
>>>> need is
>>>> a path to the repository; you don't need to go down into a
>>>> subdirectory or to any particular file.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-06-27 23:10:34 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.