Make --[no-]merge a proper option
authorGuido Günther <agx@sigxcpu.org>
Mon, 10 Jan 2011 14:17:21 +0000 (15:17 +0100)
committerGuido Günther <agx@sigxcpu.org>
Tue, 11 Jan 2011 05:46:03 +0000 (06:46 +0100)
so it can be configured via gbp.conf.

docs/manpages/git-import-orig.sgml
gbp.conf
gbp/config.py
git-import-orig

index 991ba51..b768fa9 100644 (file)
@@ -23,7 +23,7 @@
 
       <arg><option>--verbose</option></arg>
       <arg><option>--upstream-version=</option><replaceable>version</replaceable></arg>
-      <arg><option>--no-merge</option></arg>
+      <arg><option>--[no-]merge</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>
@@ -66,9 +66,9 @@
         </listitem>
       </varlistentry>
       <varlistentry>
-        <term><option>--no-merge</option></term>
+        <term><option>--merge</option></term>
         <listitem>
-         <para>Don't merge the upstream version to the development branch</para>
+         <para>Merge the upstream branch to the debian branch after import</para>
         </listitem>
       </varlistentry>
 
index 9ab4093..941d441 100644 (file)
--- a/gbp.conf
+++ b/gbp.conf
 
 # Options only affecting git-import-orig
 [git-import-orig]
-# set a different upstream branches to import to:
+# set a different upstream branch to import to:
 #upstream-branch = newupstream
 # set a different branch to merge to:
 #debian-branch = dfsgclean
+# don't merge to debian branch by default:
+#merge = False
 # import filter:
 #filter = .svn
 # filter out files from tarball passed to pristine tar:
 #filter-pristine-tar = True
-# hook run after the import:
+# run hook after the import:
 #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 8448762..51dc7e6 100644 (file)
@@ -95,6 +95,7 @@ class GbpOptionParser(OptionParser):
                  'spawn-editor'    : 'release',
                  'patch-numbers'   : 'True',
                  'notify'          : 'auto',
+                 'merge'           : 'True',
              }
     help = {
              'debian-branch':
@@ -151,6 +152,8 @@ class GbpOptionParser(OptionParser):
                   "Whether to number patch files, default is %(patch-numbers)s",
              'notify':
                   "Whether to send a desktop notification after the build, default is '%(notify)s'",
+             'merge':
+                  "after the import merge the result to the debian branch, default is '%(merge)s'",
            }
     config_files = [ '/etc/git-buildpackage/gbp.conf',
                      os.path.expanduser('~/.gbp.conf'),
index 9a09605..c735783 100755 (executable)
@@ -187,8 +187,6 @@ def main(argv):
         gbp.log.err(err)
         return 1
 
-    cl_group = GbpOptionGroup(parser, "changelog mangling",
-                      "options for mangling the changelog after the import")
     import_group = GbpOptionGroup(parser, "import options",
                       "pristine-tar and filtering")
     tag_group = GbpOptionGroup(parser, "tag options",
@@ -197,7 +195,7 @@ def main(argv):
                       "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, cmd_group ]:
+    for group in [import_group, branch_group, tag_group, cmd_group ]:
         parser.add_option_group(group)
 
     branch_group.add_option("-u", "--upstream-version", dest="version",
@@ -206,9 +204,7 @@ def main(argv):
                       dest="debian_branch")
     branch_group.add_config_file_option(option_name="upstream-branch",
                       dest="upstream_branch")
-    branch_group.add_option("--no-merge", dest='merge', action="store_false",
-                      default=True,
-                      help="after import dont do any merging to another branch")
+    branch_group.add_boolean_config_file_option(option_name="merge", dest="merge")
 
     tag_group.add_boolean_config_file_option(option_name="sign-tags",
                       dest="sign_tags")