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

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

From: Max Bowsher <maxb_at_ukf.net>
Date: 2003-08-23 12:41:09 CEST

* tools/cvs2svn/cvs2svn.py (RepositoryMirror.delete_path):
    Restructure "if" statement to eliminate duplicate code.

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
Received on Mon Aug 25 02:53:03 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.