changeset 15:21d290b44846

simplify fseed output logic
author Robin Farine <robin.farine@terminus.org>
date Tue, 31 Oct 2006 14:56:42 +0100
parents 661035098671
children e298417139cb
files forest.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
     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 @@
             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):