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

Re: problem with dump/load

From: Féliciano Matias <feliciano.matias_at_free.fr>
Date: 2002-07-16 04:20:32 CEST

Le lun 15/07/2002 à 22:11, cmpilato@collab.net a écrit :
> =?ISO-8859-1?Q?F=E9liciano?= Matias <feliciano.matias@free.fr> writes:
>
> > > Le sam 13/07/2002 à 11:23, Féliciano Matias a écrit :
> > >
> > > I reply to me.
> > > > CONCLUSION :
> > > > ============
> > > >
> > > > "svnadmin dump" seems bogus :
> > > > - "svnadmin dump" add an useless content when a node indicate only a
> > > > renaming file and this content is wrong.
> > > > - when a node indicate only a renamaing file, "svnadmin dump" try to
> > > > change the content of the node but indicate "Node-action: add".
> > >
> > > this two points are only for a binary file (perhaps for all files that
> > > have a property hash not empty).
> > >
> > > > - "svnadmin dump" forget the "real" content when only the property hash
> > > > is change or when the content has not changed (renaming file).
> > > >
> > > > personally, the dump format need to set "property hash" and "real
> > > > content" independe and it shoud be good to extend "Node-action" for a
> > > > better legibility.
> > > >
> > > >
> >
> > It's me again.
> >
> > I do a small fix in subversion/libsvn_repos/dump.c :
> >
> > --- subversion-0.13.2.orig/subversion/libsvn_repos/dump.c Sat Jul 13
> > 18:44:13 2002
> > +++ subversion-0.13.2/subversion/libsvn_repos/dump.c Sat Jul 13 18:59:36
> > 2002
> > @@ -341,6 +341,13 @@
> > return SVN_NO_ERROR;
> > }
> >
> > + /* currently, the format dump does not permit to dump either the props
> > + * or the text. We need to do both. */
> > + if (must_dump_props || must_dump_text) {
> > + must_dump_props = TRUE ;
> > + must_dump_text = TRUE ;
> > + }
> > +
> > /* Start prepping content to dump... */
> >
> > /* If the node either has no props, or we're not supposed to dump
> >
> >
> > It is not THE solution. This only resolve the fellowing problems :
>
> It is not THE solution, and it is not even accurate, unfortunately.

But it solve my problems of dump/load (for my current repository and the
exemples give in that thread).
I think this patch is right (perhaps incomplete) but it hide over
problems.

it's right because "notes/fs_dumprestore.txt" :
' The content section has two implicit parts: a property hash, and the
' fulltext. The division between these two sections is implied by the
' "PROPS-END\n" tag at the end of the prophash. In the case of a
' directory node or a revision, only the prophash is present.

A node, if it's a file, can not have only a prophash section or only a
fulltext section.

Note that "directory node or a revision, only the prophash is present"
can be understand as "fulltext is always empty".

In a repository i only change the properties of one file :
svn propset svn:executable on foo.

this is the diff of dumps (one is the r2530, one is the r2530 with the
patch) of the propset :

--- dump_test1.txt Mon Jul 15 20:26:36 2002
+++ dump_test1_fix.txt Mon Jul 15 20:25:29 2002
@@ -55,12 +55,13 @@
 Node-path: foo
 Node-kind: file
 Node-action: change
-Content-length: 37
+Content-length: 44
 
 K 14
 svn:executable
 V 2
 on
 PROPS-END
+coucou # the content is here now.

the node has only properties changed. In the dump format nothing can say
"only property change" or "only content change". There is no
"Node-action: change-prop" or "Node-action: change-text". so
"PROPS-END\n" is always fellowed by the content wherever the content is
empty or not.

> The dumper was designed so that if the "text" of a copied file did not
> change, that text was not dumped.

Property and content must always be dump.

> First, it doesn't *need* to be
> dumped because the loader gets it for free when *it* does the copy
> again at load time.

No since "Node-action" is set to "change".

> Secondly, it leaves us unable to easily ask of
> the new loaded repository, "Did the text of this file change?" because
> all such files will look (initially) as though they have textual mods.
>

The dump format can not store diffs of file. It say, file change
(proprety or text") and this is the new content (proprety and text").

> I believe this bug to be one in the loader, not the dumper, and am
> investigating it as such right now.
>

It's a good think to know the loader. But dumper (or libsvn_*) is bugus.

The other problem is the rename (and move) of a file thas has
properties.
In this case, the function dump_node() dump the beginning of a rename :
' Node-path: oof
' Node-kind: file
' Node-action: add
' Node-copyfrom-rev: 2
' Node-copyfrom-path: /foo

but when it check for change in the files, it always see properties
change in subverion/libsvn_repos/dump.c near line 357 in function
dump_node() :
' /* Need to decide if the copied node had any extra textual or
' property mods as well. */
' SVN_ERR (svn_fs_props_changed (&props_changed,
' src_root, compare_path,
' eb->fs_root, path, pool));

as i said before, i am no able to fixe this problem (too complicate for
me).

This is the problem when renaming a file.

The dumper put :
' Node-path: oof
' Node-kind: file
' Node-action: add
' Node-copyfrom-rev: 2
' Node-copyfrom-path: /foo
' Content-length: 37 # oops, error. The file has not changed.
'
' K 14
' svn:executable
' V 2
' on
' PROPS-END
' # oops, no "text". dump format don't permit this.
' # or set "text" to empty.
' Node-path: foo
' Node-action: delete

My patch don't do the right thing in this case. It only add the right
"text".

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 16 04:22:43 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.