diff options
author | Andrew Jorgensen <ajorgensen@novell.com> | 2010-08-26 22:38:00 +0400 |
---|---|---|
committer | Andrew Jorgensen <ajorgensen@novell.com> | 2010-08-26 23:29:23 +0400 |
commit | bb580b82a0e5a9c373f2c4d56450725139c420d6 (patch) | |
tree | 737b3ed6ecb584e21f10d81749d263e495a63a77 /scripts | |
parent | beabbf7a78ee309504cb01a331a0867acaabca2e (diff) |
Fix the changelog script to work in MonkeyWrench
* Makefile.am: Check for GIT_DIR if defined (rather than .git)
* commits-to-changelog.py: BUILD_REVISION rather than HEAD if defined
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/commits-to-changelog.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/commits-to-changelog.py b/scripts/commits-to-changelog.py index 8d30a4abe2f..c95f230e7d5 100755 --- a/scripts/commits-to-changelog.py +++ b/scripts/commits-to-changelog.py @@ -247,18 +247,24 @@ def main (): global path_to_root path_to_root = options.root + "/" + # MonkeyWrench uses a shared git repo but sets BUILD_REVISION, + # if present we use it instead of HEAD + HEAD = "HEAD" + if 'BUILD_REVISION' in os.environ: + HEAD = os.environ['BUILD_REVISION'] + #see if git supports %B in --format - output = git ("log", "-n1", "--format=%B", "HEAD") + output = git ("log", "-n1", "--format=%B", HEAD) if output.startswith ("%B"): print >> sys.stderr, "Error: git doesn't support %B in --format - install version 1.7.2 or newer" exit (1) - for filename in git ("ls-tree", "-r", "--name-only", "HEAD").splitlines (): + for filename in git ("ls-tree", "-r", "--name-only", HEAD).splitlines (): if re.search ("(^|/)Change[Ll]og$", filename): (path, name) = os.path.split (filename) all_changelogs [path] = name - commits = git ("rev-list", "--no-merges", "HEAD", "^%s" % start_commit).splitlines () + commits = git ("rev-list", "--no-merges", HEAD, "^%s" % start_commit).splitlines () touched_changelogs = {} for commit in commits: |