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

Re: [PATCH] [cvs2svn] Code cleanup - eliminate duplicate code

From: Sander Roobol <phy_at_wanadoo.nl>
Date: 2003-08-31 15:35:59 CEST

On Sat, Aug 23, 2003 at 11:41:09AM +0100, Max Bowsher wrote:
> * tools/cvs2svn/cvs2svn.py (RepositoryMirror.delete_path):
> Restructure "if" statement to eliminate duplicate code.

I've filed this patch together with your other cvs2svn code cleanup
patch as issue #1500:
  http://subversion.tigris.org/issues/show_bug.cgi?id=1500

Sander
  

>
> Index: cvs2svn.py
> ===================================================================
> --- cvs2svn.py (revision 6839)
> +++ cvs2svn.py (working copy)
> @@ -798,26 +798,18 @@
> for parent_item in parent_chain:
> pkey = parent_item[1]
> pval = marshal.loads(self.nodes_db[pkey])
> - if prune:
> - if (new_key == None) and is_prunable(pval):
> - pruned_count = pruned_count + 1
> - pass
> - # Do nothing more. All the action takes place when we hit a
> - # non-prunable parent.
> - else:
> - # We hit a non-prunable, so bubble up the new gospel.
> - pval[self.mutable_flag] = 1
> - if new_key == None:
> - del pval[prev_entry_name]
> - else:
> - pval[prev_entry_name] = new_key
> - new_key = gen_key()
> + if prune and (new_key == None) and is_prunable(pval):
> + pruned_count = pruned_count + 1
> + pass
> + # Do nothing more. All the action takes place when we hit a
> + # non-prunable parent.
> else:
> + # We hit a non-prunable, or aren't pruning, so bubble up the new
> gospel.
> pval[self.mutable_flag] = 1
> - if new_key:
> + if new_key == None:
> + del pval[prev_entry_name]
> + else:
> pval[prev_entry_name] = new_key
> - else:
> - del pval[prev_entry_name]
> new_key = gen_key()
>
> prev_entry_name = parent_item[0]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Aug 31 15:36:53 2003

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.