You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Marc Funaro <ma...@advantex.net> on 2006/09/22 18:42:49 UTC

Post Commit Working Copy Update - windows

Could someone please supply me with post commit hook code for a windows
batch file, that would update a working copy on the same machine where the
subversion standalone server is running? Or point me to a link?

Thanks,

Marc

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

RE: RE: Post Commit Working Copy Update - windows

Posted by "Reedick, Andrew" <An...@BellSouth.com>.
 

> -----Original Message-----
> From: Marc [mailto:subscriptions@advantex.net] 
> Sent: Friday, September 22, 2006 8:07 PM
> To: 'Andy Levy'
> Cc: 'Subversion Users List'
> Subject: RE: Post Commit Working Copy Update - windows
> 
> 
> What are the pitfalls of having "extra" files in the 
> development and live
> website directories, that are not under version control?  What is the
> likelyhood of a real disaster, and what types of things could cause a
> disaster to occur?
> 

A "problem" is that 'svn update' will not destroy work, so you will need
to audit your workspace.

* If a new version 'foo.java' is checked in, and someone has modified
'foo.java' directly in the workspace, then 'svn update' will not update
foo.java, which means that your workspace is now wrong.  This applies to
directories also.

* If you delete a directory/file, 'svn update' will not delete the
dir/file in the workspace.

Since you cannot 100% guarantee that no one will touch a file in the
workspace, or checkin a file with the same name as a file generated by
the CMS, or prevent folks from deleting files, you will need to audit
your workspace using 'svn status'.  Look for M's and D's, to find
modified or deleted files/dirs.  Use 'svn revert' to undo the M's so
they correct copy will be loaded by 'svn update'.  Deletions are a bit
trickier to process automatically because you need to parse the output
of 'svn update' to notice deletes, which is complicated by the fact that
a 'svn rename' or 'svn mv' does a delete and add.

1. 'svn status'
2. Revert (or save off) any M's
3. 'svn update' > update.log
4. Scan the update.log for deletes and delete the corresponding
workspace file/dir, unless the delete was part of a pair of add & delete
operations from a 'svn ren/mv'.

*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA621


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


RE: Post Commit Working Copy Update - windows

Posted by Marc <su...@advantex.net>.
    >   
    >   If I understand your situation right, you've already 
    >   got a WC on the server.  Sounds like a 1-liner to me:
    >   
    >   post-commit.bat:
    >   c:\progra~1\subversion\bin\svn.exe update 
    >   full_path_to_working_copy
    >   
    >   Obviously if you have multiple projects in the 
    >   repository, you'd only want to update the WC when a 
    >   commit happens for that specific project, so some extra 
    >   checks would be needed to test the path(s) committed.

It's working!  I can check out a working copy to my laptop from my server
3000 miles away.  Make a change, add a file, etc.  When I commit, it goes
back into the repository AND updates the development website, which is
simply a working copy that is on the same machine as the repository, again,
3000 miles away.  I can then check out the trunk manually to the live
website on that same machine, when the development website is confirmed
working.

Here's my next question... Is it truly unsafe to have OTHER files show up in
on the development and live sites, placed there by the content management
system code that IS in the repository?  The CMS is in the repository, the
files uploaded BY the CMS when it's in use are not, nor will they ever be.
What are the pitfalls of having "extra" files in the development and live
website directories, that are not under version control?  What is the
likelyhood of a real disaster, and what types of things could cause a
disaster to occur?

Thanks for your time... I am so excited that this seems to be so rock solid
so far...

marc

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

Re: Post Commit Working Copy Update - windows

Posted by Andy Levy <an...@gmail.com>.
On 9/22/06, Marc <su...@advantex.net> wrote:
>
>     >   Yes, your message made it to the list.  Please be
>     >   patient; this is a volunteer, free list and it
>     >   sometimes takes more than 75 minutes to get a reply to
>     >   a "please write a script for me" message.
>
> Thanks Andy,
>
> I just wasn't sure I was even making it here - I had a larger post that I
> refreshed several times that didn't a response, so when I changed my
> approach and asked for something more specific and still didn't hear from
> anyone, I started to wonder.  I am appreciative, and will be patient now
> that I know I am at least "visible" ;)

There's no guarantee that you'll get a response at all, to be honest.
I've had one or two questions that were met with silence.

If I understand your situation right, you've already got a WC on the
server.  Sounds like a 1-liner to me:

post-commit.bat:
c:\progra~1\subversion\bin\svn.exe update full_path_to_working_copy

Obviously if you have multiple projects in the repository, you'd only
want to update the WC when a commit happens for that specific project,
so some extra checks would be needed to test the path(s) committed.

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

RE: Post Commit Working Copy Update - windows

Posted by Marc <su...@advantex.net>.
 
    >   Yes, your message made it to the list.  Please be 
    >   patient; this is a volunteer, free list and it 
    >   sometimes takes more than 75 minutes to get a reply to 
    >   a "please write a script for me" message.
 
Thanks Andy,

I just wasn't sure I was even making it here - I had a larger post that I
refreshed several times that didn't a response, so when I changed my
approach and asked for something more specific and still didn't hear from
anyone, I started to wonder.  I am appreciative, and will be patient now
that I know I am at least "visible" ;)

m

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

Re: Post Commit Working Copy Update - windows

Posted by Andy Levy <an...@gmail.com>.
Yes, your message made it to the list.  Please be patient; this is a
volunteer, free list and it sometimes takes more than 75 minutes to
get a reply to a "please write a script for me" message.

On 9/22/06, Marc <su...@advantex.net> wrote:
>  Are my messages making it to the list?  Is there nobody to help a newbie?
>
>     >   -----Original Message-----
>     >   From: Marc Funaro [mailto:marc@advantex.net]
>     >   Sent: Friday, September 22, 2006 2:43 PM
>     >   To: Subversion Users List
>     >   Subject: Post Commit Working Copy Update - windows
>     >
>     >   Could someone please supply me with post commit hook
>     >   code for a windows batch file, that would update a
>     >   working copy on the same machine where the subversion
>     >   standalone server is running? Or point me to a link?
>     >
>     >   Thanks,
>     >
>     >   Marc
>     >
>     >   --------------------------------------------------------
>     >   -------------
>     >   To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>     >   For additional commands, e-mail:
>     >   users-help@subversion.tigris.org
>     >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

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

RE: RE: Post Commit Working Copy Update - windows

Posted by "Reedick, Andrew" <An...@BellSouth.com>.
> -----Original Message-----
> From: Marc [mailto:subscriptions@advantex.net] 
> Sent: Friday, September 22, 2006 4:10 PM
> To: 'Subversion Users List '
> Subject: RE: Post Commit Working Copy Update - windows
> 
> 
>  Are my messages making it to the list?  Is there nobody to 
> help a newbie?
> 
>     >   -----Original Message-----
>     >   From: Marc Funaro [mailto:marc@advantex.net] 
>     >   Sent: Friday, September 22, 2006 2:43 PM
>     >   To: Subversion Users List 
>     >   Subject: Post Commit Working Copy Update - windows
>     >   
>     >   Could someone please supply me with post commit hook 
>     >   code for a windows batch file, that would update a 
>     >   working copy on the same machine where the subversion 
>     >   standalone server is running? Or point me to a link?
>     >   


In the hooks directory in your repository, run 'notepad
post-commit.tmpl' and follow the directions.  It tells you how to create
a hook on windows.

The batch file you create will probably be something like:
	"c:\program files\subversion\bin\svn.exe" update
path_to_the_workspace

As for newbies, there are Subversion newbies, and then there are newbies
who need to RTFM.  =)
Refer to 
	http://svnbook.red-bean.com/ 
and 
	pick up a book on DOS batch programming (or search the web for a
batch file primer.)  That should be enough to get you going.


*****

The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential, proprietary, and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from all computers. GA624


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


RE: Post Commit Working Copy Update - windows

Posted by Marc <su...@advantex.net>.
 Are my messages making it to the list?  Is there nobody to help a newbie?

    >   -----Original Message-----
    >   From: Marc Funaro [mailto:marc@advantex.net] 
    >   Sent: Friday, September 22, 2006 2:43 PM
    >   To: Subversion Users List 
    >   Subject: Post Commit Working Copy Update - windows
    >   
    >   Could someone please supply me with post commit hook 
    >   code for a windows batch file, that would update a 
    >   working copy on the same machine where the subversion 
    >   standalone server is running? Or point me to a link?
    >   
    >   Thanks,
    >   
    >   Marc
    >   
    >   --------------------------------------------------------
    >   -------------
    >   To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
    >   For additional commands, e-mail: 
    >   users-help@subversion.tigris.org
    >   

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