filemanip: back up all files with git.

This includes the checksum, lock, version, and schema files.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
brian m. carlson 2013-09-24 23:34:16 +00:00
parent bae44f4791
commit dce0800a7d
No known key found for this signature in database
GPG key ID: BF535D811F52F68B

View file

@ -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)