From dce0800a7dc2ef3049161a0e9129afa19807e1b2 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Tue, 24 Sep 2013 23:34:16 +0000 Subject: [PATCH] filemanip: back up all files with git. This includes the checksum, lock, version, and schema files. Signed-off-by: brian m. carlson --- filemanip.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/filemanip.py b/filemanip.py index 0819aea..b137e05 100644 --- a/filemanip.py +++ b/filemanip.py @@ -144,7 +144,12 @@ class GitTransactionStore(TransactionStore): def commit_close(self): with self.DirectoryChanger(self._prefix) as dc: if "w" in self._mode: + potentials = [self._name + ".checksum", "lock", "version", + "schema"] self._call_git("add", self._name) + for f in potentials: + if os.access(f, os.F_OK): + self._call_git("add", f) now = datetime.datetime.utcnow() message = "Snapshot of " + self._name + " as of " message += "{:%Y-%m-%d %H:%M:%S} UTC".format(now)