[cig-commits] commit: simplify fseed output logic

Mercurial hg at geodynamics.org
Mon Nov 24 11:26:50 PST 2008


changeset:   16:d170ec7fbd39
parent:      14:ac430b95f734
user:        Robin Farine <robin.farine at terminus.org>
date:        Tue Oct 31 14:56:42 2006 +0100
files:       forest.py
description:
simplify fseed output logic


diff -r ac430b95f734 -r d170ec7fbd39 forest.py
--- a/forest.py	Wed Oct 25 10:49:52 2006 +0200
+++ b/forest.py	Tue Oct 31 14:56:42 2006 +0100
@@ -279,23 +279,20 @@ def seed(ui, repo, snapshot, pathalias, 
     cfg.read(snapshot)
     index = 1
     while True:
-        if index > 1:
-            ui.write("\n")
         index += 1
         section = 'tree' + str(index)
         if not cfg.has_section(section):
             break
         root = cfg.get(section, 'root')
+        ui.write("[%s]\n" % root)
         dest = util.localpath(root)
         psect = section + '.paths'
         if not cfg.has_option(psect, pathalias):
-            ui.write(_("skipped, no path alias '%s' defined for tree '%s'\n") %
-                    (pathalias, dest))
+            ui.write(_("skipped, no path alias '%s' defined\n\n") % pathalias)
             continue
         source = cfg.get(psect, pathalias)
-        ui.write("[%s]\n" % root)
         if os.path.exists(dest):
-            ui.write(_("skipped, destination '%s' already exists\n") % dest)
+            ui.write(_("skipped, destination '%s' already exists\n\n") % dest)
             continue
         destpfx = os.path.dirname(dest)
         if destpfx and not os.path.exists(destpfx):
@@ -309,6 +306,8 @@ def seed(ui, repo, snapshot, pathalias, 
             if rev and rev != node.nullid:
                 repo = repository(ui, dest)
                 commands.update(repo.ui, repo, node=rev)
+        ui.write("\n")
+
 
 
 def snapshot(ui, repo, snapfile=None):



More information about the CIG-COMMITS mailing list