You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Dzintars Brikis <dz...@mebius.lv> on 2008/06/10 12:29:39 UTC

Username Change in SVN

Hi!

Is it possible to change usernames in SVN?

Best regards,
Dzintars Brikis
Mebius IT

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Kevin Grover <ke...@kevingrover.net>.
On Tue, Jun 10, 2008 at 5:29 AM, Dzintars Brikis
<dz...@mebius.lv> wrote:
> Hi!
>
> Is it possible to change usernames in SVN?
>
> Best regards,
> Dzintars Brikis
> Mebius IT
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>


Just an FYI, if you need to change a lot of svn:author entries, you
can use svndumptool (the python version):

svnadmin dump path/to/my/repo > repo.dump

svndumptool transform-revprop svn:author originalregexp newvalue
repo.dump newrepo.dump

NOTE: originalregexp is a regular expression, so it will match in the
middle of strings, use "^original$" to anchor it if needed.  NOTE TO
NOTE: use ^^ on windows because ^ is magic on the command line.

Then load newrepo.dump (and move the hooks/ and conf/ from the other repo).

- Kevin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Dzintars Brikis <dz...@mebius.lv>.
Lutz Dornbusch wrote:

> Dzintars Brikis wrote:
>
>> Hi!
>>
>> Is it possible to change usernames in SVN?
>>
>> Best regards,
>> Dzintars Brikis
>> Mebius IT
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>> For additional commands, e-mail: users-help@subversion.tigris.org
>>
>
> Hi Dzintars,
> what do you men by "change usernames"?
> - changing the usernames in commited revisions?
>     use "svn propset --revprop svn:author"
>
> - use username / passwords for svn commands like svn co/ci ..
>     use the --username switch to provide a different username. Note 
> that  this username will be stored into your .subversion home 
> directory, so svn will remember this last name. add --no-auth-cache to 
> avoid this
>
> Greetings,
> Lutz

Hi Lutz!

Regarding "changing the usernames in commited revisions":
1. Is the exact command "svn propset svn:author --revprop -r xxx 
new-author-name filespec" ? or do you mean something else with "svn 
propset --revprop svn:author" ?
2. So I can change only if I specify http link in this command or path 
to file from check-outed repository..... and there is no other way how 
to change this name ?
3. Also could you provide example for how to show and then replace 
usernames to some specific file for all revisions, if the old username 
would be a.smith ; the new username would be alexander.smith and target 
file would be lets say at such path: /svn/project1/file.pls ? ... so - 
what should be the propset command for such situation and how (with what 
syntax) to see that author has changed for specific revision.

Dzintars

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Lutz Dornbusch <sv...@yogasurftech.de>.
Dzintars Brikis wrote:
> Hi!
> 
> Is it possible to change usernames in SVN?
> 
> Best regards,
> Dzintars Brikis
> Mebius IT
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
> 

Hi Dzintars,
what do you men by "change usernames"?
- changing the usernames in commited revisions?
     use "svn propset --revprop svn:author"

- use username / passwords for svn commands like svn co/ci ..
     use the --username switch to provide a different username. Note 
that  this username will be stored into your .subversion home directory, 
so svn will remember this last name. add --no-auth-cache to avoid this

Greetings,
Lutz

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Ryan Schmidt <su...@ryandesign.com>.
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 <dz...@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@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Paul Koning <Pa...@dell.com>.
>>>>> "Dzintars" == Dzintars Brikis <dz...@mebius.lv> writes:

 Dzintars> Ok - now I understand the thing about changing (at least
 Dzintars> for getting info I am sure that I know how - its working),
 Dzintars> BUT with the propset command I am not so successfull,
 Dzintars> because I am getting such error:
 Dzintars> ---------------------------------- svn: DAV request failed;
 Dzintars> it's possible that the repository's pre-revprop-change hook
 Dzintars> either failed or is non-existent svn: At least one property
 Dzintars> change failed; repository is unchanged
 Dzintars> ---------------------------------- So what I am missing or
 Dzintars> what I have to do additional to get this command working ?
 Dzintars> At least I have pre-revprop-change.tmpl file in hook
 Dzintars> folder, but I dont understand - is this just a template and
 Dzintars> should be renamed/replaced or some additional changes must
 Dzintars> be done so that this script starts to work.

Yes.  It's all very clearly documented in the book that Ryan pointed
to.

	paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Dzintars Brikis <dz...@mebius.lv>.
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 <dz...@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@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Ryan Schmidt <su...@ryandesign.com>.
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 <dz...@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@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Dzintars Brikis <dz...@mebius.lv>.
1. Ok, then if I change username for whole revision - how I check what 
is the author for revision?
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 ?

Dzintars


Paul Koning wrote:

>>>>>>"Dzintars" == Dzintars Brikis <dz...@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.
>
>	     paul
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Paul Koning <Pa...@dell.com>.
>>>>> "Dzintars" == Dzintars Brikis <dz...@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.

	     paul


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Dzintars Brikis <dz...@mebius.lv>.
Hi Andy!

Regarding "Changing the username in a transaction" - can you give me 
examples for:
1. how to check author for specific file for all revisions.
2. how to change author for specific file for all revisions or at least 
one revision.
IF
I would have such example:old username - a.smith ; new username - 
alexander.smith ; target file at such path: /svn/project1/file.pls .

Dzintars

Andy Levy wrote:

>Please make sure you Reply To All to keep discussion on-list.
>
>On Wed, Jun 11, 2008 at 2:27 AM, Dzintars Brikis
><dz...@mebius.lv> wrote:
>  
>
>>Hi Andy!
>>
>>I mean both first 2 (username in transaactions and username to authenticate)
>>    
>>
>
>Changing the username in a transaction requires that you modify the
>svn:author revprop.
>
>Changing a user's username just requires that you change it in your
>authorization & authentication files. If you're using SSH or LDAP for
>your authentication, this could get a little trickier. You'll also
>need them to clear their cached credentials on the client side.
>
>Why not just issue the user a new ID, and disable the old one?
>
>  
>
>>Andy Levy wrote:
>>
>>    
>>
>>>On Tue, Jun 10, 2008 at 8:29 AM, Dzintars Brikis
>>><dz...@mebius.lv> wrote:
>>>
>>>      
>>>
>>>>Hi!
>>>>
>>>>Is it possible to change usernames in SVN?
>>>>
>>>>        
>>>>
>>>You'll have to be more specific. Do you mean:
>>>
>>>*Change the username associated with a transaction?
>>>*Change a user's credentials so they use to authenticate to the server?
>>>*Clear the cached credentials on a user's client system?
>>>*Other?
>>>
>>>      
>>>
>>    
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Andy Levy <an...@gmail.com>.
Please make sure you Reply To All to keep discussion on-list.

On Wed, Jun 11, 2008 at 2:27 AM, Dzintars Brikis
<dz...@mebius.lv> wrote:
> Hi Andy!
>
> I mean both first 2 (username in transaactions and username to authenticate)

Changing the username in a transaction requires that you modify the
svn:author revprop.

Changing a user's username just requires that you change it in your
authorization & authentication files. If you're using SSH or LDAP for
your authentication, this could get a little trickier. You'll also
need them to clear their cached credentials on the client side.

Why not just issue the user a new ID, and disable the old one?

> Andy Levy wrote:
>
>> On Tue, Jun 10, 2008 at 8:29 AM, Dzintars Brikis
>> <dz...@mebius.lv> wrote:
>>
>>>
>>> Hi!
>>>
>>> Is it possible to change usernames in SVN?
>>>
>>
>> You'll have to be more specific. Do you mean:
>>
>> *Change the username associated with a transaction?
>> *Change a user's credentials so they use to authenticate to the server?
>> *Clear the cached credentials on a user's client system?
>> *Other?
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Username Change in SVN

Posted by Andy Levy <an...@gmail.com>.
On Tue, Jun 10, 2008 at 8:29 AM, Dzintars Brikis
<dz...@mebius.lv> wrote:
> Hi!
>
> Is it possible to change usernames in SVN?

You'll have to be more specific. Do you mean:

*Change the username associated with a transaction?
*Change a user's credentials so they use to authenticate to the server?
*Clear the cached credentials on a user's client system?
*Other?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org