export GBP_BRANCH to postimport hook
authorGuido Günther <agx@sigxcpu.org>
Mon, 5 Oct 2009 16:13:08 +0000 (18:13 +0200)
committerGuido Günther <agx@sigxcpu.org>
Mon, 5 Oct 2009 16:14:30 +0000 (18:14 +0200)
so we can pass the current branch to git-dch

gbp.conf
git-import-orig

index 0401132..f396362 100644 (file)
--- a/gbp.conf
+++ b/gbp.conf
@@ -40,7 +40,7 @@
 # filter out files from tarball passed to pristine tar
 #filter-pristine-tar = True
 # hook run after the import:
-#postimport = git-dch -N%(version)s -S -a
+#postimport = git-dch -N%(version)s -S -a --debian-branch=$GBP_BRANCH
 # emulate old behaviour of calling dch:
 #postimport = dch -v%(version)s New Upstream Version
 
index 9438e6a..a8e4d3c 100755 (executable)
@@ -390,7 +390,8 @@ on howto create it otherwise use --upstream-branch to specify it.
                         if has_epoch(cp):
                             epoch = '%s:' % cp['Epoch']
                     info = { 'version': "%s%s-1" % (epoch, version) }
-                    cmd = gbpc.Command(options.postimport % info, shell=True)()
+                    env = { 'GBP_BRANCH': options.debian_branch }
+                    cmd = gbpc.Command(options.postimport % info, extra_env=env, shell=True)()
         except gbpc.CommandExecFailed:
             raise GbpError, "Import of %s failed" % archive
     except GbpNothingImported, err: