diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2010-08-19 12:33:02 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2010-09-17 20:07:16 +0200 |
commit | ee0e9ffe0a69d1ae1080f8087725015ae0ff8bc4 (patch) | |
tree | caf48559cc9cc07b7d201a381e39ae9adc3ff48f /git-import-orig | |
parent | 083834b407e2e76e1386f9004e495a88f2906cf4 (diff) |
Let git-import-orig find the changelog when not on the debian-branch.
When no changelog file is available in the checkout, look for the
changelog in the repository. This allows for using git-import-orig when
the upstream branch is checked out, for example.
Diffstat (limited to 'git-import-orig')
-rwxr-xr-x | git-import-orig | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/git-import-orig b/git-import-orig index 031198d7..32309ba7 100755 --- a/git-import-orig +++ b/git-import-orig @@ -309,10 +309,17 @@ on howto create it otherwise use --upstream-branch to specify it. # Try to find the source package name try: - cp = parse_changelog('debian/changelog') + cp = parse_changelog(filename='debian/changelog') sourcepackage = cp['Source'] except NoChangelogError: - sourcepackage = ask_package_name(guessed_package) + try: + # Check the changelog file from the repository, in case + # we're not on the debian-branch (but upstream, for + # example). + cp = parse_changelog_repo(repo, options.debian_branch, 'debian/changelog') + sourcepackage = cp['Source'] + except NoChangelogError: + sourcepackage = ask_package_name(guessed_package) # Try to find the version. if options.version: @@ -396,7 +403,10 @@ on howto create it otherwise use --upstream-branch to specify it. if options.postimport: epoch = '' if os.access('debian/changelog', os.R_OK): - cp = parse_changelog('debian/changelog') + # No need to check the changelog file from the + # repository, since we're certain that we're on + # the debian-branch + cp = parse_changelog(filename='debian/changelog') if has_epoch(cp): epoch = '%s:' % cp['Epoch'] info = { 'version': "%s%s-1" % (epoch, version) } |