You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Patterson <da...@danpat.net> on 2005/02/16 09:32:18 UTC

Committing modifications with fulltext deltas

Hello,

One of my users wants to be able to do "svn import" over the top
of an existing structure without having to have a working copy,
doing modifications of existing items, adding new ones and deleting
things that aren't there (a-la svn_load_dirs.pl)

I've been looking at what it'd take to implement this, and I think
it's reasonably doable.  If my understanding is progressing right,
I should be able to create a commit editor and perform a bunch
of add_file, add_directory and (open_file, apply_textdelta, close_file)
operations, then commit.

I can see how an add_file would work just fine without a text-base to
create a delta stream with, but I'm not sure of the implication
of not having a text-base available to calculate a delta for modifications.

Looking through libsvn_wc/adm_crawler.c:svn_wc_transmit_text_deltas,
it seems that the use of text-base (indicated with the "fulltext"
parameter) is optional, and things will work just fine if that is
always set to true (albeit slower).

Does the delta that's sent over-the-wire have any affect on the delta
that's stored in the repository?  Or is the new fulltext calculated,
and then a new delta created for storage in the filesystem (i.e.
is the over-the-wire delta simply for efficiency and it'll work
whether you send a fulltext delta or a text-base based delta?)?

daniel

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

Re: Committing modifications with fulltext deltas

Posted by Daniel Patterson <da...@danpat.net>.
> On Wed, 2005-02-16 at 04:32, Daniel Patterson wrote:
> I'm not sure how you'd know when to do add_file and when to do
> open_file.  You could grab a recursive directory listing first, but I'm
> not certain how you could ensure that the directory listing is of the
> same rev you're committing against.

  I was thinking something like:
    1) discover the head revision (rH)
    2) retrieve the recursive directory listing for rH
    3) commit, using revision numbers discovered in (2)

  And hopefully, a commit would fail with an out-of-dateness error
  if someone snuck a commit between 1 and 3.  libsvn_repos/commit.c
  seems to need a revision parameter for most operations, which I
  assume I can just pass rH.

daniel

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

Re: Committing modifications with fulltext deltas

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2005-02-16 at 04:32, Daniel Patterson wrote:
> I've been looking at what it'd take to implement this, and I think
> it's reasonably doable.  If my understanding is progressing right,
> I should be able to create a commit editor and perform a bunch
> of add_file, add_directory and (open_file, apply_textdelta, close_file)
> operations, then commit.

I'm not sure how you'd know when to do add_file and when to do
open_file.  You could grab a recursive directory listing first, but I'm
not certain how you could ensure that the directory listing is of the
same rev you're committing against.

> I can see how an add_file would work just fine without a text-base to
> create a delta stream with, but I'm not sure of the implication
> of not having a text-base available to calculate a delta for modifications.

If the delta is computed against the empty stream, it should work
regardless of what the server applies it to.


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

Re: Committing modifications with fulltext deltas

Posted by Daniel Patterson <da...@danpat.net>.
Marcus Rueckert wrote:
> hi
> 
> doesnt this imply something like that:
> http://subversion.tigris.org/faq.html#wc-change-detection
> 

   Yes, but that's ok and a loss of copy-history is the price
   you pay for not using a working copy.  svn_load_dirs has some
   heuristics to try and guess when renames/copies have happened,
   it might be possible to add some of that, or add another mechanism
   (i.e. a mapping file) that allows one to indicate what elements
   that are part of the import should be copied/renamed.

   For my immediate needs, a dumb import will do the trick.

daniel

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

Re: Committing modifications with fulltext deltas

Posted by Marcus Rueckert <da...@web.de>.
hi

doesnt this imply something like that:
http://subversion.tigris.org/faq.html#wc-change-detection

just my 2 cents.

darix

-- 
irssi - the client of the smart and beautiful people

              http://www.irssi.de/


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

Re: Committing modifications with fulltext deltas

Posted by Branko Čibej <br...@xbc.nu>.
Daniel Patterson wrote:

> Hello,
>
> One of my users wants to be able to do "svn import" over the top
> of an existing structure without having to have a working copy,
> doing modifications of existing items, adding new ones and deleting
> things that aren't there (a-la svn_load_dirs.pl)
>
> I've been looking at what it'd take to implement this, and I think
> it's reasonably doable.  If my understanding is progressing right,
> I should be able to create a commit editor and perform a bunch
> of add_file, add_directory and (open_file, apply_textdelta, close_file)
> operations, then commit.
>
> I can see how an add_file would work just fine without a text-base to
> create a delta stream with, but I'm not sure of the implication
> of not having a text-base available to calculate a delta for 
> modifications.
>
> Looking through libsvn_wc/adm_crawler.c:svn_wc_transmit_text_deltas,
> it seems that the use of text-base (indicated with the "fulltext"
> parameter) is optional, and things will work just fine if that is
> always set to true (albeit slower).
>
> Does the delta that's sent over-the-wire have any affect on the delta
> that's stored in the repository?  Or is the new fulltext calculated,
> and then a new delta created for storage in the filesystem (i.e.
> is the over-the-wire delta simply for efficiency and it'll work
> whether you send a fulltext delta or a text-base based delta?)?

The delta that's sent over the wire bears no relation to what's stored 
in the repository. If it did, client behaviour would dictate how the 
server internally stores file revisions. Perish the thought. :-)

-- Brane


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