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

Re: [PATCH] recognize replaced paths in mailer.py (needs change in svn/repos.py)

From: Mathias Weinert <mathias.weinert_at_gfa-net.de>
Date: 2006-08-30 14:55:24 CEST

> André Malo wrote:
> > * Mathias Weinert wrote:
> >
> > > André Malo wrote:
> > > > wrt the changes in repos.py: This should be documented in the change
> > > > log I think, as it's an incompatible change.
> > >
> > > Sorry, but I don't understand what you want to say here. Could you
> > > please explain this to me (what is incompatible with what)? Thanks.
> >
> > svn.repos is a common library. So if something's changed there in a
> > backwards incompatible way, it should be noted at some place where
> > developers can find it (before updating).
>
> So what about the following patch. It doesn't change the parameter list
> of __init__ (and is smaller anyway)?

Anyone willing to commit my patch (or to modify it)?
Without someone patching the python bindings I can't commit the change
to mailer.py (which I really would like to).
Thank you very much!

Mathias

--- repos.py.orig 2006-08-10 09:15:33.801134900 +0200
+++ repos.py 2006-08-22 16:46:00.184779900 +0200
@@ -50,6 +50,12 @@
     ### if the rev is always repos.rev - 1, or whether it represents the
     ### created or time-of-checkout rev. so... we use a flag (for now)
     self.added = added
+
+ ### this additional flag is needed to store information if a path was
+ ### a newly added one or if it was a replace action
+ ### it cannot be set be __init__ in order to leave the parameter list
+ ### unchanged
+ self.replaced = False
 
 
 class ChangeCollector(_delta.Editor):
@@ -126,6 +132,9 @@
 
   def add_directory(self, path, parent_baton,
                     copyfrom_path, copyfrom_revision, dir_pool=None):
+ # if this add is a replace there is already a change record inserted
+ # by a delete, so in this case set replaced to True below.
+ is_replace = self.changes.has_key(path)
     self.changes[path] = ChangedPath(_core.svn_node_dir,
                                      False,
                                      False,
@@ -134,6 +143,7 @@
                                      path, # path
                                      True, # added
                                      )
+ self.changes[path].replaced = is_replace
     if copyfrom_path and (copyfrom_revision != -1):
       base_path = copyfrom_path
     else:
@@ -162,6 +172,9 @@
 
   def add_file(self, path, parent_baton,
                copyfrom_path, copyfrom_revision, file_pool=None):
+ # if this add is a replace there is already a change record inserted
+ # by a delete, so in this case set replaced to True below.
+ is_replace = self.changes.has_key(path)
     self.changes[path] = ChangedPath(_core.svn_node_file,
                                      False,
                                      False,
@@ -170,6 +183,7 @@
                                      path, # path
                                      True, # added
                                      )
+ self.changes[path].replaced = is_replace
     if copyfrom_path and (copyfrom_revision != -1):
       base_path = copyfrom_path
     else:

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Aug 30 15:07:37 2006

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.