<arg><option>--verbose</option></arg>
<arg><option>--upstream-version=</option><replaceable>version</replaceable></arg>
<arg><option>--no-merge</option></arg>
- <arg><option>--no-dch</option></arg>
<arg><option>--upstream-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--debian-branch=</option><replaceable>branch_name</replaceable></arg>
<arg><option>--[no-]sign-tags</option></arg>
<arg><option>--filter=</option><replaceable>pattern</replaceable></arg>
<arg><option>--[no-]pristine-tar</option></arg>
<arg><option>--[no-]filter-pristine-tar</option></arg>
+ <arg><option>--postimport=cmd</option></arg>
<arg choice="plain"><replaceable>upstream-source</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<para>Don't merge the upstream version to the development branch</para>
</listitem>
</varlistentry>
- <varlistentry>
- <term><option>--no-dch</option></term>
- <listitem>
- <para>don't call dch after the import</para>
- </listitem>
- </varlistentry>
+
<varlistentry>
<term><option>--upstream-branch</option>=<replaceable>branch_name</replaceable>
</term>
passed to pristine tar</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--postimport=<replaceable>cmd</replaceable></option></term>
+ <listitem>
+ <para>run <replaceable>cmd</replaceable> after the import.</para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect1>
<refsect1>
"options related to git tag creation")
branch_group = GbpOptionGroup(parser, "version and branch naming options",
"version number and branch layout options")
+ cmd_group = GbpOptionGroup(parser, "external command options", "how and when to invoke external commands and hooks")
- for group in [import_group, branch_group, cl_group, tag_group ]:
+ for group in [import_group, branch_group, cl_group, tag_group, cmd_group ]:
parser.add_option_group(group)
- cl_group.add_config_file_option(option_name="no-dch", dest='no_dch',
- help="don't call dch after the import", action="store_true")
-
branch_group.add_option("-u", "--upstream-version", dest="version",
help="Upstream Version")
branch_group.add_config_file_option(option_name="debian-branch",
dest="pristine_tar")
import_group.add_boolean_config_file_option(option_name="filter-pristine-tar",
dest="filter_pristine_tar")
+ cmd_group.add_config_file_option(option_name="postimport", dest="postimport",
+ help="hook run after a successful import, default is '%(postimport)s'")
parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False,
help="verbose command execution")
+
+ # Accepted for compatibility
+ parser.add_option("--no-dch", dest='no_dch', action="store_true",
+ default=False, help="deprecated - don't use.")
+
(options, args) = parser.parse_args(argv[1:])
if options.verbose:
gbpc.Command.verbose = True
+ if options.no_dch:
+ print >>sys.stderr, "'--no-dch' passed. This is now the default, please remove this option."
+
if options.filters:
turn_off_fastimport(options, "Import filters currently not supported with fastimport.")
try:
gbpc.GitMerge(tag)()
except gbpc.CommandExecFailed:
- raise GbpError, """Merge failed, please resolve and run "dch -v %s-1".""" % version
- if not options.no_dch:
+ raise GbpError, """Merge failed, please resolve.""" % version
+ if options.postimport:
epoch = ''
if os.access('debian/changelog', os.R_OK):
cp = parse_changelog('debian/changelog')
if has_epoch(cp):
epoch = '%s:' % cp['Epoch']
- gbpc.Dch("%s%s-1" % (epoch, version), 'New Upstream Version')()
+ info = { 'version': "%s%s-1" % (epoch, version) }
+ cmd = gbpc.Command(options.postimport % info, shell=True)()
except gbpc.CommandExecFailed:
raise GbpError, "Import of %s failed" % archive
except GbpNothingImported, err: