You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2003/11/07 16:14:41 UTC

dropping support for old (format 1) working copies

On the partial-authz-dev branch, we've added a new entry attribute
'absent', for partially authorized working copies.

Since old clients don't know how to use the new attribute, and won't
get correct behavior by ignoring it, we've upgraded SVN_WC__VERSION to
3.  However, since only a new client will ever produce the new
attribute, it's trivial to upgrade a working copy from format 2 to
format 3 -- just bump the format number (while holding a write lock,
of course).

I'm writing a function, libsvn_wc/lock.c:upgrade_format(), to do that.
However, upgrading from wc format 1 to 3 is much more involved than
upgrading from 2 to 3.  (There are no theoretical problems, it just
involves a lot of coding, to fix up the base and working propfile
names, both regular props and wcprops).

Frankly, I'd like not to bother spending the half day that it would
require.  Most people probably have format 2 working copies anyway,
and there are more important things to spend time on.

Would anyone object if the client just gave a verbose error on
encountering a version 1 working copy?  Our code hasn't created such
working copies for well over a year now.  I'm sure there are some
still out there, but an error telling people to check out again isn't
the worst thing in the world, from pre-1.0 software.
   
Thanks,
-Karl

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

Re: dropping support for old (format 1) working copies

Posted by Philip Martin <ph...@codematters.co.uk>.
Colin Watson <cj...@flatline.org.uk> writes:

> On Fri, Nov 07, 2003 at 05:31:19PM -0000, Max Bowsher wrote:
>> Colin Watson wrote:
>> > Oof.
>> >
>> >   [cjwatson@riva ~]$ cat .svn/format
>> >   1
>> >
>> > Trying to check out my home directory again is going to give me a
>> > serious headache
>> 
>> Why? Because its big, or because you can't delete and re-create your home
>> dir?
>
> Because not all of it's checked in and there are several necessarily
> uncommitted changes there. Also I need to be extremely careful about
> what I remove; it's not as if I can just do 'rm -rf ~'.

If you do not have lots uncommitted property changes, then you could
use GNU tar as follows:

  $ cd /home
  $ tar cfz philip.tgz --exclude .svn philip/
  $ mv philip/ philip.old/  # or rm if you are confident!
  $ svn checkout $URL philip/
  $ tar xfz philip.tgz
  $ rm -rf philip.old/

This will preserve the most of the state of all your versioned and
unversioned files and directories (versioned directory timestamps will
change), but will lose any uncommitted property changes.  The new
working copy will have a lot of "broken" text and property timestamps,
so things like "svn status" will run slowly.  These can be "repaired"
using a HEAD client as follows

  $ SVN_EDITOR=/bin/false svn ci philip/

which is a commit that will abort when the log message editor fails.

-- 
Philip Martin

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

Re: dropping support for old (format 1) working copies

Posted by kf...@collab.net.
Colin Watson <cj...@flatline.org.uk> writes:
> Looking at what Karl said, it appears that a procedure for converting a
> wc in-place from version 1 to version 2 is as follows:
> 
>   set -e
>   find .svn/props .svn/wcprops -type f -print | while read x; do
>     mv "$x" "$x".svn-work
>   done
>   echo 2 > .svn/format
> 
> Is this correct? It'd be a lot easier than trying to perform a new
> checkout for me.

I believe that's the idea, but haven't tested it, and can't promise
good results :-).

-Karl

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

Re: dropping support for old (format 1) working copies

Posted by Colin Watson <cj...@flatline.org.uk>.
On Fri, Nov 07, 2003 at 03:04:19PM -0600, Ben Collins-Sussman wrote:
> On Fri, 2003-11-07 at 14:50, Colin Watson wrote:
> > Because not all of it's checked in and there are several necessarily
> > uncommitted changes there. Also I need to be extremely careful about
> > what I remove; it's not as if I can just do 'rm -rf ~'.
> 
> $ cd wc
> $ svn diff wc > ~/mychanges.patch
> $ cd ..;  rm -rf wc
> $ svn co http://....  new-wc
> $ cd new-wc
> $ patch -p0 < ~/mychanges.patch

This illustrates my point, I think. 'svn diff' will not record the
contents of unversioned files, so 'rm -rf ~' after saving its output is
a recipe for losing a great deal of data for me. Checking in one's home
directory necessarily involves a lot of unversioned files.

Looking at what Karl said, it appears that a procedure for converting a
wc in-place from version 1 to version 2 is as follows:

  set -e
  find .svn/props .svn/wcprops -type f -print | while read x; do
    mv "$x" "$x".svn-work
  done
  echo 2 > .svn/format

Is this correct? It'd be a lot easier than trying to perform a new
checkout for me.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]

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

Re: dropping support for old (format 1) working copies

Posted by "B. W. Fitzpatrick" <fi...@red-bean.com>.
"Max Bowsher" <ma...@ukf.net> writes:
> B. W. Fitzpatrick wrote:
> > Ben Collins-Sussman <su...@collab.net> writes:
> >> On Fri, 2003-11-07 at 14:50, Colin Watson wrote:
> >> 
> >>>> Why? Because its big, or because you can't delete and re-create
> >>>> your home dir?
> >>> 
> >>> Because not all of it's checked in and there are several necessarily
> >>> uncommitted changes there. Also I need to be extremely careful about
> >>> what I remove; it's not as if I can just do 'rm -rf ~'.
> >> 
> >> $ cd wc
> >> $ svn diff wc > ~/mychanges.patch
> >> $ cd ..;  rm -rf wc
> >> $ svn co http://....  new-wc
> >> $ cd new-wc
> >> $ patch -p0 < ~/mychanges.patch
> > 
> > Sorry Ben, it's not that easy.  I've had my home directory under
> > version control for years now, and I'll betch that Colin has a ton of
> > stuff being svn:ignored and doesn't want to have to cull his working
> > copy for that stuff.  Am I right?
> > 
> > Anyway, if that's the case, after you do what Ben points out above,
> > write a little shell script that deletes all 'svn:ignore' properties
> > in your working copy (don't forget any global ignores you set in your
> > ~/.subversion directory), then run svn st on your working directory
> 
> Or, just run "svn st --no-ignore".

Oh duh.

CVS has corrupted my brain.

:-)

-Fitz

--
Brian W. Fitzpatrick    <fi...@red-bean.com>   http://www.red-bean.com/fitz/



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

Re: dropping support for old (format 1) working copies

Posted by Max Bowsher <ma...@ukf.net>.
B. W. Fitzpatrick wrote:
> Ben Collins-Sussman <su...@collab.net> writes:
>> On Fri, 2003-11-07 at 14:50, Colin Watson wrote:
>> 
>>>> Why? Because its big, or because you can't delete and re-create
>>>> your home dir?
>>> 
>>> Because not all of it's checked in and there are several necessarily
>>> uncommitted changes there. Also I need to be extremely careful about
>>> what I remove; it's not as if I can just do 'rm -rf ~'.
>> 
>> $ cd wc
>> $ svn diff wc > ~/mychanges.patch
>> $ cd ..;  rm -rf wc
>> $ svn co http://....  new-wc
>> $ cd new-wc
>> $ patch -p0 < ~/mychanges.patch
> 
> Sorry Ben, it's not that easy.  I've had my home directory under
> version control for years now, and I'll betch that Colin has a ton of
> stuff being svn:ignored and doesn't want to have to cull his working
> copy for that stuff.  Am I right?
> 
> Anyway, if that's the case, after you do what Ben points out above,
> write a little shell script that deletes all 'svn:ignore' properties
> in your working copy (don't forget any global ignores you set in your
> ~/.subversion directory), then run svn st on your working directory

Or, just run "svn st --no-ignore".

> and all the (previously) ignored files will show with ? marks next to
> them. With the help of your favorite editor, you should be able to
> turn this into a list of files to copy into your new working copy.
> 
> -Fitz

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

Re: dropping support for old (format 1) working copies

Posted by "B. W. Fitzpatrick" <fi...@red-bean.com>.
Ben Collins-Sussman <su...@collab.net> writes:
> On Fri, 2003-11-07 at 14:50, Colin Watson wrote:
> 
> > > Why? Because its big, or because you can't delete and re-create your home
> > > dir?
> > 
> > Because not all of it's checked in and there are several necessarily
> > uncommitted changes there. Also I need to be extremely careful about
> > what I remove; it's not as if I can just do 'rm -rf ~'.
> 
> $ cd wc
> $ svn diff wc > ~/mychanges.patch
> $ cd ..;  rm -rf wc
> $ svn co http://....  new-wc
> $ cd new-wc
> $ patch -p0 < ~/mychanges.patch

Sorry Ben, it's not that easy.  I've had my home directory under version
control for years now, and I'll betch that Colin has a ton of stuff
being svn:ignored and doesn't want to have to cull his working copy for
that stuff.  Am I right?

Anyway, if that's the case, after you do what Ben points out above,
write a little shell script that deletes all 'svn:ignore' properties in
your working copy (don't forget any global ignores you set in your
~/.subversion directory), then run svn st on your working directory and
all the (previously) ignored files will show with ? marks next to them.
With the help of your favorite editor, you should be able to turn this
into a list of files to copy into your new working copy.

-Fitz

--
Brian W. Fitzpatrick    <fi...@red-bean.com>   http://www.red-bean.com/fitz/



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

Re: dropping support for old (format 1) working copies

Posted by Ben Collins-Sussman <su...@collab.net>.
On Fri, 2003-11-07 at 14:50, Colin Watson wrote:

> > Why? Because its big, or because you can't delete and re-create your home
> > dir?
> 
> Because not all of it's checked in and there are several necessarily
> uncommitted changes there. Also I need to be extremely careful about
> what I remove; it's not as if I can just do 'rm -rf ~'.

$ cd wc
$ svn diff wc > ~/mychanges.patch
$ cd ..;  rm -rf wc
$ svn co http://....  new-wc
$ cd new-wc
$ patch -p0 < ~/mychanges.patch






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

Re: dropping support for old (format 1) working copies

Posted by Colin Watson <cj...@flatline.org.uk>.
On Fri, Nov 07, 2003 at 05:31:19PM -0000, Max Bowsher wrote:
> Colin Watson wrote:
> > Oof.
> >
> >   [cjwatson@riva ~]$ cat .svn/format
> >   1
> >
> > Trying to check out my home directory again is going to give me a
> > serious headache
> 
> Why? Because its big, or because you can't delete and re-create your home
> dir?

Because not all of it's checked in and there are several necessarily
uncommitted changes there. Also I need to be extremely careful about
what I remove; it's not as if I can just do 'rm -rf ~'.

> If the latter:
> 
> Commit any uncommited changes.
> Erase all .svn directories and versioned content.
> svn co file:///repos/homedir .

I guess that might be a start, but an in-place conversion would be an
order of magnitude less hassle if I could automate it. I'll follow up on
what Karl suggested.

Thanks,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]

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

Re: dropping support for old (format 1) working copies

Posted by Max Bowsher <ma...@ukf.net>.
Colin Watson wrote:
> On Fri, Nov 07, 2003 at 10:14:41AM -0600, kfogel@collab.net wrote:
>> Would anyone object if the client just gave a verbose error on
>> encountering a version 1 working copy?  Our code hasn't created such
>> working copies for well over a year now.  I'm sure there are some
>> still out there, but an error telling people to check out again isn't
>> the worst thing in the world, from pre-1.0 software.
>
> Oof.
>
>   [cjwatson@riva ~]$ cat .svn/format
>   1
>
> Trying to check out my home directory again is going to give me a
> serious headache

Why? Because its big, or because you can't delete and re-create your home
dir?

If the latter:

Commit any uncommited changes.
Erase all .svn directories and versioned content.
svn co file:///repos/homedir .

Max.


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

Re: dropping support for old (format 1) working copies

Posted by kf...@collab.net.
Colin Watson <cj...@flatline.org.uk> writes:
> Oof.
> 
>   [cjwatson@riva ~]$ cat .svn/format
>   1
> 
> Trying to check out my home directory again is going to give me a
> serious headache ... can you recommend a manual procedure for doing the
> conversion?

If it were a simple manual procedure, it would be simple to code :-).

Search for SVN_WC__OLD_PROPNAMES_VERSION in libsvn_wc, look at what
the code is doing in those conditionals, and do the same thing
yourself, basically.

Good luck!

-Karl


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

Re: dropping support for old (format 1) working copies

Posted by Colin Watson <cj...@flatline.org.uk>.
On Fri, Nov 07, 2003 at 10:14:41AM -0600, kfogel@collab.net wrote:
> Would anyone object if the client just gave a verbose error on
> encountering a version 1 working copy?  Our code hasn't created such
> working copies for well over a year now.  I'm sure there are some
> still out there, but an error telling people to check out again isn't
> the worst thing in the world, from pre-1.0 software.

Oof.

  [cjwatson@riva ~]$ cat .svn/format
  1

Trying to check out my home directory again is going to give me a
serious headache ... can you recommend a manual procedure for doing the
conversion?

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]

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

Re: dropping support for old (format 1) working copies

Posted by "B. W. Fitzpatrick" <fi...@red-bean.com>.
kfogel@collab.net writes:

> Would anyone object if the client just gave a verbose error on
> encountering a version 1 working copy?  Our code hasn't created such
> working copies for well over a year now.  I'm sure there are some
> still out there, but an error telling people to check out again isn't
> the worst thing in the world, from pre-1.0 software.

I am so +1 on this that my feet are tingling.

-Fitz

--
Brian W. Fitzpatrick    <fi...@red-bean.com>   http://www.red-bean.com/fitz/


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