Thanks for that quick response.  I understood that it uses the source username 
for the initial 'mirror' commit.  I just didn't realize the order that the 
svnsync did things.

The problem is that, when using svnsync, the post-commit hook is called before 
all the properties have been updated to the same info as in the source 
repository.  

To work around this timing issue, I've move my post commit logic to the post 
revision prop change hook,  as this is activated consistently when using 
svnsync to mirror a repository.  

Since this hook is called multiple times, I've put a check in the hook to only 
run my logic when the author prop has been updated.

Hope this helps others that might encounter the same issue.

Jb

-----Original Message-----
From: [EMAIL PROTECTED]
To: "Trac Users" <[email protected]>
Sent: 10/28/08 3:22 PM
Subject: [Trac] Re: svn post commit hook returning incorrect author for svnsync?


On Oct 28, 1:24 pm, bradtwurst <[EMAIL PROTECTED]> wrote:
> I am encountering an issue that I hope the community can point me in
> the correct direction.
>
> I have trac 0.11.1 installed on a ubuntu server.  My svn repository is
> on a different box and is accessible via an https:// address.
>
> I have a cron job that run the svnsync command
>
> svnsync synchronize  --non-interactive --source-username svnsync --
> source-password svnsync file:///var/lib/svn/software
>
> which does bring over the changes, but the post-commit hook is showing
> the incorrect owner.
>
> The post-commit hook script is
>
> #!/bin/sh
> REPOS="$1"
> REV="$2"
> LOG=`svnlook log -r $REV $REPOS`
> AUTHOR=`svnlook author -r $REV $REPOS`
> TRAC_ENV='/var/lib/trac/software'
>
> echo "svnlook author" >> /var/log/svnsync.log
> svnlook author -r $REV $REPOS >> /var/log/svnsync.log
> echo "Trac env: $TRAC_ENV" >> /var/log/svnsync.log
> echo "revision: $REV" >> /var/log/svnsync.log
> echo "author: $AUTHOR" >> /var/log/svnsync.log
> echo "log: $LOG" >> /var/log/svnsync.log
> echo "repos: $REPOS" >> /var/log/svnsync.log
>
> /usr/bin/python /usr/local/bin/trac-post-commit.py \
>   -p "$TRAC_ENV"  \
>   -r "$REV"
>
> and svnlook is reporting that author is 'svnsync' and the changeset
> inside of my trac reports the same.
>
> If I run svnlook from the command line, I get the correct author.  If
> I run trac-admin . resync, then the author information is correct for
> the changeset.
>
> Any ideas what I don't have set correctly?
>
> Thanks,
> jb

um...

> --source-username svnsync

Jay
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to