You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Robert P. J. Day" <rp...@crashcourse.ca> on 2008/09/17 08:47:14 UTC

how to undo turning a directory into an external?

   last night, i had a fairly unpleasant experience transforming a  
directory into an external, then trying to undo that.

   under subversion 1.4.3, i removed a directory in my working copy  
and replaced it with an external reference to an equivalent directory  
in another repository, since they were allegedly identical.  it took  
only minutes to realize that they were *not* identical, so i went  
about trying to revert that change, and that's where the ugliness began.

   sadly, i don't have a record of the steps in front of me, but the  
first attempt to just merge the reverse of that revision in my WC gave  
me an error something along the lines of "directory is already there".  
  i tried a couple more things, and finally had to resort to:

   1) checking out the previous revision
   2) saving the directory in /tmp
   3) going back to the new working copy, copying that directory in,
      "svn add"ing it, and re-committing it as if it were new content

   is/was there an issue with simply undoing that kind of operation?  if
it's worth the time, i can try it all again on a throwaway branch and
record the results.  thanks.

rday


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


Re: how to undo turning a directory into an external?

Posted by John Peacock <jo...@havurah-software.org>.
Ryan Schmidt wrote:
> If it's not exactly that problem, there is at least a similar one:
> 
> http://subversion.tigris.org/issues/show_bug.cgi?id=2371

But if you'll follow my recipe, I commit the propdel before trying to restore
the directory, so the above bug won't happen.

> After the "svn ci" wouldn't an "svn up" have removed the dir, removing
> the need for the below steps?

No the directory won't be removed, merely marked as unversioned (this is a Good
Thing, as it prevents data loss).  You must delete it or move it out of the way
before you can reverse merge the original delete (or else the files will
obstruct the merge, even if they are 100% identical).

> But if you were wanting to commit the removal of the svn:externals
> property and the return of the real dir as a single revision, as you
> might reasonably want to do, then manually removing dir would be necessary.

The point of #2371 is that you *cannot* remove an svn:external and replace it
with any versioned resource in the same commit.

John

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

Re: how to undo turning a directory into an external?

Posted by "Robert P. J. Day" <rp...@crashcourse.ca>.
Quoting Ryan Schmidt <su...@ryandesign.com>:

>
> On Sep 17, 2008, at 04:26, John Peacock wrote:
>
>> Robert P. J. Day wrote:
>>>  is/was there an issue with simply undoing that kind of operation?  if
>>> it's worth the time, i can try it all again on a throwaway branch and
>>> record the results.  thanks.
>>
>> No, there isn't a problem with undoing that kind of operation,
>
> If it's not exactly that problem, there is at least a similar one:
>
> http://subversion.tigris.org/issues/show_bug.cgi?id=2371

   yup, that's the one.  thanks.

rday


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

Re: how to undo turning a directory into an external?

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Sep 17, 2008, at 04:26, John Peacock wrote:

> Robert P. J. Day wrote:
>>   is/was there an issue with simply undoing that kind of  
>> operation?  if
>> it's worth the time, i can try it all again on a throwaway branch and
>> record the results.  thanks.
>
> No, there isn't a problem with undoing that kind of operation,

If it's not exactly that problem, there is at least a similar one:

http://subversion.tigris.org/issues/show_bug.cgi?id=2371


> but you have to
> move obstructing files out of the way.  Here is the sequence that  
> you probably
> should have followed:
>
> # deleting the original path, you might need a commit before the  
> propset
> svn rm dir
> svn ps svn:externals http://other/server/path dir
> svn ci

After the "svn ci" wouldn't an "svn up" have removed the dir,  
removing the need for the below steps?

But if you were wanting to commit the removal of the svn:externals  
property and the return of the real dir as a single revision, as you  
might reasonably want to do, then manually removing dir would be  
necessary.


> # Here you discovered that everything was not OK, so unset the  
> externals
> svn pd svn:externals dir
> svn ci
>
> # This is the step you skipped, get the old files out of the way
> mv dir /tmp/dir
>
> # this will undo the 'svn rm dir' above, note this URL is the  
> parent of dir
> svn merge -c-999 http://path/to/original/url
> svn ci
>
> NOTE that this is from memory (not actually tested in this  
> sequence), but should
> be accurate (or close to it).  The issue is that you have to both  
> commit the
> propdel (so the WC doesn't have any record of a directory being  
> there) *AND*
> move the now unversioned directory/files out of the way.


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

Re: how to undo turning a directory into an external?

Posted by John Peacock <jo...@havurah-software.org>.
Robert P. J. Day wrote:
>   is/was there an issue with simply undoing that kind of operation?  if
> it's worth the time, i can try it all again on a throwaway branch and
> record the results.  thanks.

No, there isn't a problem with undoing that kind of operation, but you have to
move obstructing files out of the way.  Here is the sequence that you probably
should have followed:

# deleting the original path, you might need a commit before the propset
svn rm dir
svn ps svn:externals http://other/server/path dir
svn ci

# Here you discovered that everything was not OK, so unset the externals
svn pd svn:externals dir
svn ci

# This is the step you skipped, get the old files out of the way
mv dir /tmp/dir

# this will undo the 'svn rm dir' above, note this URL is the parent of dir
svn merge -c-999 http://path/to/original/url
svn ci

NOTE that this is from memory (not actually tested in this sequence), but should
be accurate (or close to it).  The issue is that you have to both commit the
propdel (so the WC doesn't have any record of a directory being there) *AND*
move the now unversioned directory/files out of the way.

HTH

John

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

Re: how to undo turning a directory into an external?

Posted by David Weintraub <qa...@gmail.com>.
Any commits done? Externals and directory deletes are (of course)
versioned, so you can always go back to an earlier version of your
repository and backout the undesired changes.

--
David Weintraub
qazwart@gmail.com



On Wed, Sep 17, 2008 at 4:47 AM, Robert P. J. Day <rp...@crashcourse.ca> wrote:
>  last night, i had a fairly unpleasant experience transforming a directory
> into an external, then trying to undo that.
>
>  under subversion 1.4.3, i removed a directory in my working copy and
> replaced it with an external reference to an equivalent directory in another
> repository, since they were allegedly identical.  it took only minutes to
> realize that they were *not* identical, so i went about trying to revert
> that change, and that's where the ugliness began.
>
>  sadly, i don't have a record of the steps in front of me, but the first
> attempt to just merge the reverse of that revision in my WC gave me an error
> something along the lines of "directory is already there".  i tried a couple
> more things, and finally had to resort to:
>
>  1) checking out the previous revision
>  2) saving the directory in /tmp
>  3) going back to the new working copy, copying that directory in,
>     "svn add"ing it, and re-committing it as if it were new content
>
>  is/was there an issue with simply undoing that kind of operation?  if
> it's worth the time, i can try it all again on a throwaway branch and
> record the results.  thanks.
>
> rday
>
>
> ---------------------------------------------------------------------
> 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