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

Commit a mixed revision working copy as new HEAD?

From: Zachary Pincus <zpincus_at_stanford.edu>
Date: 2005-02-24 05:24:35 CET


I'm wondering if there is a way to commit a mixed revision working copy
as the new HEAD.

This need came about because I was trying to figure out how to back out
of some problems I had. Specifically, I needed to un-delete one file
and roll back another file to the exact state it was several revisions

It was easy to do the following:
svn update -r100 file1 # roll back to the the good revision of file1
svn update -r120 file2 # get the last version of file2 before it
was deleted

Now I had a working copy that looked exactly like what I wanted HEAD to
look like. Unfortunately, I couldn't figure out a way to commit things
like this.

Instead, for the roll back I had to execute:
svn merge -rHEAD:100 file1

and for the undelete I had to execute:
svn copy -r120 URL://repository/very/long/path/to/the/darn/file2 file2

This all seems clunky and counterintuitive. Using svn merge for the
roll-back isn't really the first thing I thought of, since I didn't
want to merge a single patch (or "backward patch"), but just revert to
a prior state entirely. And using svn copy required typing in a long
URL path, which I found odd since svn update didn't require a URL.

It seems like these two tasks are basically identical: take a file from
a previous revision and add it to the working copy in a way that it can
be committed to HEAD. However the tool you have to use is different
depending on the current state of the file in the repository. That is,
svn copy can't be used for the roll-back task because it refuses to
overwrite the existing (wrong) version of file1, while svn merge can't
be used for the undelete task because it can't find file2 in the local
copy or in the HEAD version of the repository, so it doesn't know what
to merge.

So here we have two semantically similar operations that require two
completely different commands with different syntax, where neither
command is perfectly suited to the task. If there were some way to take
a working copy after some careful svn updates (note that svn update has
consistent syntax and semantics for file retrieval) and commit that as
the new HEAD, I would be overjoyed. Is this possible?

Zach Pincus

Department of Biochemistry and Program in Biomedical Informatics
Stanford University School of Medicine

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 24 05:27:07 2005

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.