views:

865

answers:

2

I've got a Subversion repository, and there are a number of users checking things in and out. However, I also need to frequently check in work for other people. I need to track the original author of the work.

I was considering creating a property in SVN, like "originalauthor", which could track this. In cases where it was empty, I could use the author. If it was filled in, I could attribute the changes appropriately.

However, I can't see a way to add a property that won't persist through multiple revisions. Similarly, there doesn't seem to be a way of using commit hooks to guarantee the "originalauthor" property will be removed if there's a commit which doesn't include it.

I could always rewrite the password file on the server to allow me to commit under their username and then restore the original password file, but that seems clunky (and doesn't let me track the fact that it was checked in on their behalf). Or I could create an additional user (so for every "User A" there's a "User A Proxy") which I could use to check in changes. Neither of these options seem appealing.

Any suggestions, or ideas?

A: 

Why not have a separate branch for all the other users (who need proxies) and then when you review them (I assume you check in on their behalf because they are not allowed to do so) then you promote to the trunk?

I am not sure why the other users are not allowed to check in on their own. PErhaps if you explain that we can provide better answers.

Tim
The users are allowed to check in on their own. But many of them are highly nontechnical, and unused to working with source control systems. Ideally, they'd all learn, but I'm not in a position to force them to.
Chris B.
+6  A: 

Subversion has two kinds of properties

  • Properties on a file or directory. These properties are versioned
  • Revision properties. These are specific to the reversion on which they apply.

The first type is only usefull if you want all versions of the file to be marked.

To mark a specific path the Subversion project itself adds the original author to the log message in a special format that is read by the contribulyzer script:

Patch by: Jan Jansen <[email protected]>

But if you have tooling available (and can assume subversion 1.5+) you could also use

svn commit --with-revprop "original-author=Jan Jansen <[email protected]>"

to create a orignal-author revision property.

To retrieve the property you can then use svn log as:

svn log <...> --with-revprop original-author
Bert Huijben
I think this will work, especially if I have a post-commit script add the property if it's missing.
Chris B.