You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Tor Ringstad <to...@pvv.org> on 2007/10/21 22:10:34 UTC
Copying BASE revision of WC path
Is it possible to directly make a copy of the BASE revision of a WC
path? That is, get a copy of a locally modified path *without* the
local modifications?
For instance, one could have expected this to work:
% svn cp -r BASE foo bar
But it will in fact give the following rather curious error message:
svn: A path under version control is needed for this operation
- Tor Ringstad -
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Copying BASE revision of WC path
Posted by Karl Fogel <kf...@red-bean.com>.
Tor Ringstad <to...@pvv.org> writes:
> It isn't obvious to me how you would recover this information. When I
> look at the log for a copy operation on a WC containing a file with
> local modifications, I see this:
>
> Changed paths:
> A /branches/mybranch (from /trunk:10)
> M /branches/mybranch/foo
>
> Here, it is obvious that foo had local changes, but what was its BASE
> revision? Or is this meant to be interpreted as foo's BASE being the
> same as its parent, i.e. r10?
If no further copy operation (that is, 'A'dd with history) is given
for a path Q, and some parent of Q was added in this revision, then
Q's BASE rev is the same as that of Q's parent. Apply this rule
recursively upward, if necessary :-).
> My plan was to create the branch with two commits:
>
> % svn cp -rBASE . svn://somehost/somerepo/branches/mybranch
> % svn switch svn://somehost/somerepo/branches/mybranch
> % svn commit
>
> This way it would be trivial to recover the initial local changeset,
> just by diffing the first and the second commits on the branch.
You might want to run 'svn up' first, to get a consistent, unmixed
revision tree in your working copy, before you branch from it.
But as you can see, it's also possible to recover the diff even if you
don't do create the branch separately from the commit, it just might
take a bit more work / scripting.
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Copying BASE revision of WC path
Posted by Tor Ringstad <to...@pvv.org>.
> Your summary question at the end reverses the order of the two
> proposed behaviors you listed,
Hmmm, how very inconsistent of me.
> [...] it should be (1) -- copy the complex mixed revisions,
> switches, etc. And if you eliminate the "-rBASE", it should apply
> your local mods after doing copies of the base revisions
Yup, put that way, the behaviour in (1) sounds consistent and just
what one would expect from "-rBASE".
> in other words, technically it should be possible to recover your
> local diff from a branch created with:
>
> $ svn cp . svn://somehost/somerepo/branches/mybranch
It isn't obvious to me how you would recover this information. When I
look at the log for a copy operation on a WC containing a file with
local modifications, I see this:
Changed paths:
A /branches/mybranch (from /trunk:10)
M /branches/mybranch/foo
Here, it is obvious that foo had local changes, but what was its BASE
revision? Or is this meant to be interpreted as foo's BASE being the
same as its parent, i.e. r10?
My plan was to create the branch with two commits:
% svn cp -rBASE . svn://somehost/somerepo/branches/mybranch
% svn switch svn://somehost/somerepo/branches/mybranch
% svn commit
This way it would be trivial to recover the initial local changeset,
just by diffing the first and the second commits on the branch.
- Tor Ringstad -
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Copying BASE revision of WC path
Posted by Karl Fogel <kf...@red-bean.com>.
Tor Ringstad <to...@pvv.org> writes:
> The background for the question was that I'm toying around with some
> ideas for "persistent changelists" aka "shelves", and being able to
> create a branch from the BASE of a WC with local changes seemed to be
> a good starting point.
>
> The next question is if the following command line is actually
> supposed to do what I'm expecting of it:
>
> % cd <WC-root>
> % svn cp -rBASE . svn://somehost/somerepo/branches/mybranch
>
> That is, should it
>
> 1) create a copy that exactly reflects the state of my WC *without*
> local changes, including any mixed revisions and/or switches, or
>
> 2) create a copy of "." as seen in its BASE revision?
>
> Or put another way, should "BASE" be evaluated for the top-level of
> the copy operation only, or individually for each of the sub-targets?
Your summary question at the end reverses the order of the two
proposed behaviors you listed, but yes, it should be (1) -- copy the
complex mixed revisions, switches, etc. And if you eliminate the
"-rBASE", it should apply your local mods after doing copies of the
base revisions -- in other words, technically it should be possible to
recover your local diff from a branch created with:
$ svn cp . svn://somehost/somerepo/branches/mybranch
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Copying BASE revision of WC path
Posted by Tor Ringstad <to...@pvv.org>.
> This is http://subversion.tigris.org/issues/show_bug.cgi?id=1643.
Aha, there was an issue already...I wasn't able to track down that
one.
The background for the question was that I'm toying around with some
ideas for "persistent changelists" aka "shelves", and being able to
create a branch from the BASE of a WC with local changes seemed to be
a good starting point.
The next question is if the following command line is actually
supposed to do what I'm expecting of it:
% cd <WC-root>
% svn cp -rBASE . svn://somehost/somerepo/branches/mybranch
That is, should it
1) create a copy that exactly reflects the state of my WC *without*
local changes, including any mixed revisions and/or switches, or
2) create a copy of "." as seen in its BASE revision?
Or put another way, should "BASE" be evaluated for the top-level of
the copy operation only, or individually for each of the sub-targets?
> Hey, nice to see you in Munich last week!
Likewise, it was a really good conference.
- Tor Ringstad -
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: Copying BASE revision of WC path
Posted by Karl Fogel <kf...@red-bean.com>.
Tor Ringstad <to...@pvv.org> writes:
> Is it possible to directly make a copy of the BASE revision of a WC
> path? That is, get a copy of a locally modified path *without* the
> local modifications?
>
> For instance, one could have expected this to work:
>
> % svn cp -r BASE foo bar
>
> But it will in fact give the following rather curious error message:
>
> svn: A path under version control is needed for this operation
Hey, nice to see you in Munich last week!
This is http://subversion.tigris.org/issues/show_bug.cgi?id=1643. In
latest trunk, it still gets an error, but a different one:
$ svn info | grep URL
URL: http://svn.collab.net/repos/svn/trunk
$ svn up
At revision 27301.
$ svn st -q
$ svn cp -rBASE README NEW_README
subversion/libsvn_wc/lock.c:601: (apr_err=155007)
svn: 'http://svn.collab.net/repos/svn/trunk' is not a working copy
subversion/libsvn_subr/io.c:2626: (apr_err=2)
svn: Can't open file 'http://svn.collab.net/repos/svn/trunk/.svn/entries':
No such file or directory
$
I don't have time to work on it right now, but if you felt like having
a look at it, I suspect the cause would not be too hard to track down.
Even just adding a regression test would be helpful.
Best,
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org