[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: Jan Hendrik <list.jan.hendrik_at_gmail.com>
Date: Wed, 29 Jul 2009 21:58:34 +0200

Concerning Re: Need to run an SVN Update which
Hyrum K. Wright wrote on 29 Jul 2009, 8:34, at least in part:

> 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.

Well, there is one situation when svn update will cause local
changes being lost: the respective file is open in an editor which
does not lock the file like e.g. Word97 does (bad example as Word
files are binary and SVN would not attempt to merge changes in
the first place, but no other application locking files opened comes
to my mind) and it has changes yet not saved. If the editor is
halfway decent it will ask the user to reload the file as someone
else (svn in this case) has modified it. If the user clicks Yes,
reload, his unsaved changes are lost, if he says No, don't reload,
and saves later the changes svn update had just brought in are lost
and effectively undone on the next commit. The same goes for
editors which even do not notice background file modifications.

Of course it's not SVN's fault but user failure to run svn update
without saving his own work first. Something that should not
happen, yet does, but very rarely.

JH
---------------------------------------
Freedom quote:

    "I get mad for a guy named Washington,
     and a guy named Jefferson, and Lincoln.
     Lighthouses, John. Lighthouses in a foggy world."
               -- James Gleason as Henry Connell in
                  "Meet John Doe" by Frank Capra, 1941

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

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