]> arthur.barton.de Git - bup.git/blobdiff - cmd/save-cmd.py
Merge initial bup rm command
[bup.git] / cmd / save-cmd.py
index 4fa6dcae1981532311953c0577386ab5e0a9901a..56351efd66cd84100b41bd969124a9ff6edaaacb 100755 (executable)
@@ -12,9 +12,10 @@ import os, sys, stat, time, math
 from bup import hashsplit, git, options, index, client, metadata, hlinkdb
 from bup.hashsplit import GIT_MODE_TREE, GIT_MODE_FILE, GIT_MODE_SYMLINK
 from bup.helpers import (add_error, grafted_path_components, handle_ctrl_c,
-                         istty2, log, parse_date_or_fatal, parse_num,
+                         hostname, istty2, log, parse_date_or_fatal, parse_num,
                          path_components, progress, qprogress, resolve_parent,
-                         saved_errors, stripped_path_components)
+                         saved_errors, stripped_path_components,
+                         userfullname, username)
 
 
 optspec = """
@@ -454,7 +455,9 @@ if opt.tree:
     print tree.encode('hex')
 if opt.commit or opt.name:
     msg = 'bup save\n\nGenerated by command:\n%r\n' % sys.argv
-    commit = w.new_commit(oldref, tree, date, msg)
+    userline = '%s <%s@%s>' % (userfullname(), username(), hostname())
+    commit = w.new_commit(tree, oldref, userline, date, None,
+                          userline, date, None, msg)
     if opt.commit:
         print commit.encode('hex')