summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-01-11 07:27:15 +0100
committerGuido Günther <agx@sigxcpu.org>2011-01-11 07:47:13 +0100
commit5ca57cda04278ecc1e88740a4380179f3df5560f (patch)
treeef0cfc03184c0ca4ccde2d19aab1e69281c467b0
parent03f3d75d43458978ecc375f7e16cfc8f35b5ae99 (diff)
downloadgit-buildpackage-5ca57cda04278ecc1e88740a4380179f3df5560f.tar.gz
git-buildpackage-5ca57cda04278ecc1e88740a4380179f3df5560f.tar.bz2
git-buildpackage-5ca57cda04278ecc1e88740a4380179f3df5560f.zip
git-import-dsc: also set the commit date to the changelog date
when importing old history. This makes sure we get proper sorting with e.g. gitk. Thanks: Rob Browning for the hint and explanation
-rw-r--r--gbp/git.py9
-rwxr-xr-xgit-import-dsc3
2 files changed, 8 insertions, 4 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 3dab7d88..d344ab56 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -370,7 +370,7 @@ class GitRepository(object):
GitCommand("update-ref")(args)
def commit_tree(self, tree, msg, parents, author=None, email=None,
- date=None):
+ date=None, commit_date=None):
"""Commit a tree with commit msg 'msg' and parents 'parents'"""
extra_env = {}
if author:
@@ -379,6 +379,8 @@ class GitRepository(object):
extra_env['GIT_AUTHOR_EMAIL'] = email
if date:
extra_env['GIT_AUTHOR_DATE'] = date
+ if commit_date:
+ extra_env['GIT_COMMITTER_DATE'] = commit_date
args = [ tree ]
for parent in parents:
@@ -387,7 +389,7 @@ class GitRepository(object):
return sha1
def commit_dir(self, unpack_dir, msg, branch, other_parents=None,
- author = None, email = None, date = None):
+ author = None, email = None, date = None, commit_date = None):
"""Replace the current tip of branch 'branch' with the contents from 'unpack_dir'
@param unpack_dir: content to add
@param msg: commit message to use
@@ -424,7 +426,8 @@ class GitRepository(object):
parents += [ sha ]
commit = self.commit_tree(tree=tree, msg=msg, parents=parents,
- author=author, email=email, date=date)
+ author=author, email=email, date=date,
+ commit_date=commit_date)
if not commit:
raise GbpError, "Failed to commit tree"
self.update_ref("refs/heads/%s" % branch, commit, cur)
diff --git a/git-import-dsc b/git-import-dsc
index 409e3459..0c56eda2 100755
--- a/git-import-dsc
+++ b/git-import-dsc
@@ -109,7 +109,8 @@ def apply_debian_patch(repo, unpack_dir, src, options, parents):
other_parents = parents,
author = author,
email = email,
- date = date)
+ date = date,
+ commit_date = date)
gitTag(build_tag(options.debian_tag, version),
msg="Debian release %s" % version, commit=commit)
except gbpc.CommandExecFailed: