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

Re: Need to run an SVN Update which preserves local changes

From: Daniel Becroft <djcbecroft_at_gmail.com>
Date: Thu, 30 Jul 2009 11:20:14 +1000

On Thu, Jul 30, 2009 at 11:01 AM, Nico Kadel-Garcia <nkadel_at_gmail.com>wrote:

> On Wed, Jul 29, 2009 at 9:34 AM, Hyrum K. Wright<hyrum_at_hyrumwright.org>
> wrote:
> > On Jul 29, 2009, at 8:28 AM, Ryan Schmidt wrote:
> >
> >> On Jul 29, 2009, at 08:18, Alexander Maw wrote:
> >>
> >>> It just occurred to me that I might preserve locally changed files
> >>> by having a script identify and backup locally changed files and
> >>> restore them after the SVN update, is there an SVN command to
> >>> output if a file has local changes?
> >>
> >> Yes, "svn status". Lines beginning with "M" are files with modified
> >> contents.
> >
> > The other question would be "why do you need to backup locally changed
> > files?" Subversion will merge the updates with your local changes, or
> > flag a conflict if it can't do the merge automatically. Subversion is
> > designed *never* to remove or overwrite local changes.
> >
> > It could be that you are looking for a solution to a non-existent
> > problem.
>
> Because you may not be ready to change them to the new updated
> information, especially if you're like some people and share trunk
> directories. The easy approach is:
>
> working-copy> svn info . # To get the current revision
> working-copy> tar cpzvf /tmp/working-copy-revision.tar.gz --exclude=.svn
> working-copy> svn update
> working-copy> tar xpzvf /tmp/working-copy-revision.tar.gz
> working-copy> svn status
> working-copy> svn diff
>
> If you want to be clever, you can use the output of 'svn status' to
> produce a list of target files to put in the tarball, or use 'rsync
> -avH --exclude=.svn --delete --delete-excluded' to make a clean local
> copy, then 'rsync -avH' without the --delete options to bring the
> material back..
>
> But given the vagaries of upstream updates and merges, I've used this
> technique repeatedly to bring in updates or changes and make sure my
> working copies are preserved.
>

Why bother running an 'svn update' at all, then, if you don't want the
latest changes that 'svn update' will bring down?

Cheers,
Daniel B.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2376786

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-07-30 03:21:16 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.