import-dsc: allow to skip Debian tag creation
authorGuido Günther <agx@sigxcpu.org>
Tue, 5 Nov 2013 08:31:12 +0000 (09:31 +0100)
committerGuido Günther <agx@sigxcpu.org>
Tue, 5 Nov 2013 08:36:15 +0000 (09:36 +0100)
Closes: #636368

docs/manpages/gbp-import-dsc.sgml
gbp/scripts/import_dsc.py

index 192b521..bc2211c 100644 (file)
@@ -28,6 +28,7 @@
       <arg><option>--keyid=</option><replaceable>gpg-keyid</replaceable></arg>
       <arg><option>--debian-tag=</option><replaceable>tag-format</replaceable></arg>
       <arg><option>--upstream-tag=</option><replaceable>tag-format</replaceable></arg>
+      <arg><option>--skip-debian-tag=</option></arg>
       <arg><option>--filter=</option><replaceable>pattern</replaceable></arg>
       <arg><option>--[no-]pristine-tar</option></arg>
       <arg><option>--download</option></arg>
         </listitem>
       </varlistentry>
       <varlistentry>
+        <term><option>--skip-debian-tag</option></term>
+        <listitem>
+          <para>Don't create Debian tag after importing the Debian patch. This can be useful
+          if you already created a package but want to further work on it after importing it
+          into git.</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
         <term><option>--filter=</option><replaceable>pattern</replaceable>
         </term>
         <listitem>
index 11c47e8..1744362 100644 (file)
@@ -134,11 +134,12 @@ def apply_debian_patch(repo, unpack_dir, src, options, parents):
                                  other_parents = parents,
                                  author=author,
                                  committer=committer)
-        repo.create_tag(repo.version_to_tag(options.debian_tag, src.version),
-                        msg="Debian release %s" % src.version,
-                        commit=commit,
-                        sign=options.sign_tags,
-                        keyid=options.keyid)
+        if not options.skip_debian_tag:
+            repo.create_tag(repo.version_to_tag(options.debian_tag, src.version),
+                            msg="Debian release %s" % src.version,
+                            commit=commit,
+                            sign=options.sign_tags,
+                            keyid=options.keyid)
     except (gbpc.CommandExecFailed, GitRepositoryError) as err:
         msg = err.__str__() if len(err.__str__()) else ''
         gbp.log.err("Failed to import Debian package: %s" % msg)
@@ -220,6 +221,10 @@ def parse_args(argv):
                       dest="debian_tag")
     tag_group.add_config_file_option(option_name="upstream-tag",
                       dest="upstream_tag")
+    tag_group.add_option("--skip-debian-tag",dest="skip_debian_tag",
+                         action="store_true", default=False,
+                         help="Don't add a tag after importing the Debian patch")
+
 
     import_group.add_config_file_option(option_name="filter",
                       dest="filters", action="append")
@@ -335,11 +340,12 @@ def main(argv):
                                          author=author,
                                          committer=committer)
 
-                repo.create_tag(name=tag,
-                                msg=msg,
-                                commit=commit,
-                                sign=options.sign_tags,
-                                keyid=options.keyid)
+                if not (src.native and options.skip_debian_tag):
+                    repo.create_tag(name=tag,
+                                    msg=msg,
+                                    commit=commit,
+                                    sign=options.sign_tags,
+                                    keyid=options.keyid)
                 if not src.native:
                     if is_empty:
                         repo.create_branch(options.upstream_branch, commit)