[cig-commits] commit: simplify fseed output logic

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


changeset:   15:21d290b44846
parent:      10:661035098671
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 661035098671 -r 21d290b44846 forest.py
--- a/forest.py	Mon Oct 23 19:36:56 2006 +0200
+++ b/forest.py	Tue Oct 31 14:56:42 2006 +0100
@@ -276,23 +276,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):
@@ -306,6 +303,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