changeset 39113:cb906289b04e

pygnulib: postpone ignore files backup
author Dmitry Selyutin <ghostmansd@gmail.com>
date Fri, 29 Jun 2018 10:05:31 +0300
parents 62e78104251e
children 7025642fe93e
files pygnulib.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pygnulib.py	Fri Jun 29 10:04:59 2018 +0300
+++ b/pygnulib.py	Fri Jun 29 10:05:31 2018 +0300
@@ -489,7 +489,6 @@
                 try:
                     with vfs_iostream(project, path,  "rb", "UTF-8") as stream:
                         ignores = [line.strip() for line in stream.readlines()]
-                    vfs_backup(project, path)
                     present = True
                 except:
                     present = False
@@ -505,6 +504,8 @@
                         include.add(name)
                 if include or (set(ignores) & exclude):
                     print(f"Updating {path} (backup in {path}~)", file=sys.stdout)
+                    if present:
+                        vfs_backup(project, path)
                     with vfs_iostream(project, path,  "wb", "UTF-8") as stream:
                         for entry in ignores:
                             if entry not in exclude: