From ccbc07d833a27d458bd7c9ebaecb1594249bca26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Fri, 5 Jan 2024 12:12:46 +0800 Subject: [PATCH] WIP: Switch default Debian branch to 'debian/latest' (Closes: #829444) As defined by DEP14, the default Debian packaging branch name should be 'debian/latest' instead of 'master. https://dep-team.pages.debian.net/deps/dep14/ --- docs/chapters/cfgfile.xml | 4 +- docs/chapters/import.xml | 10 +- docs/chapters/intro.xml | 6 +- docs/chapters/special.xml | 14 +- docs/manpages/gbp-buildpackage-rpm.xml | 2 +- docs/manpages/gbp-buildpackage.xml | 2 +- docs/manpages/gbp-clone.xml | 2 +- docs/manpages/gbp-config.xml | 2 +- docs/manpages/gbp-create-remote-repo.xml | 2 +- docs/manpages/gbp-dch.xml | 2 +- docs/manpages/gbp-import-dsc.xml | 2 +- docs/manpages/gbp-import-orig.xml | 4 +- docs/manpages/gbp-import-ref.xml | 2 +- docs/manpages/gbp-import-srpm.xml | 2 +- docs/manpages/gbp-pq-rpm.xml | 4 +- docs/manpages/gbp-pq.xml | 4 +- docs/manpages/gbp-pull.xml | 2 +- docs/manpages/gbp-rpm-ch.xml | 2 +- docs/manpages/gbp-tag.xml | 2 +- docs/po/de.po | 62 ++++----- docs/po/gbp.pot | 62 ++++----- gbp.conf | 3 +- gbp/config.py | 4 +- gbp/scripts/buildpackage.py | 4 +- gbp/scripts/common/pq.py | 8 +- tests/03_test_dch_guess_version.py | 12 +- tests/04_test_submodules.py | 10 +- tests/07_test_fastimport.py | 6 +- tests/10_test_get_upstream_tree.py | 4 +- tests/13_test_gbp_pq.py | 26 ++-- tests/22_test_gbp_buildpackage.py | 2 +- tests/24_test_gbp_import_orig.py | 12 +- .../28_test_gbp_git_repository_commit_dir.py | 10 +- tests/component/deb/fixtures.py | 14 +- tests/component/deb/test_buildpackage.py | 16 +-- tests/component/deb/test_clone.py | 10 +- tests/component/deb/test_dch.py | 2 +- tests/component/deb/test_import_dsc.py | 50 +++---- tests/component/deb/test_import_dscs.py | 2 +- tests/component/deb/test_import_orig.py | 44 +++--- tests/component/deb/test_import_ref.py | 8 +- tests/component/deb/test_pq.py | 28 ++-- tests/component/deb/test_pristine_tar.py | 6 +- tests/component/deb/test_pull.py | 16 +-- tests/component/deb/test_push.py | 42 +++--- .../component/deb/test_setup_gitattributes.py | 8 +- tests/component/deb/test_tag.py | 16 +-- tests/component/rpm/test_import_orig_rpm.py | 42 +++--- tests/component/rpm/test_import_srpm.py | 34 ++--- tests/component/rpm/test_pq_rpm.py | 126 +++++++++--------- tests/component/rpm/test_rpm_ch.py | 2 +- tests/doctests/test_GitRepository.py | 62 ++++----- 52 files changed, 411 insertions(+), 412 deletions(-) diff --git a/docs/chapters/cfgfile.xml b/docs/chapters/cfgfile.xml index 16272a7b..a02ee042 100644 --- a/docs/chapters/cfgfile.xml +++ b/docs/chapters/cfgfile.xml @@ -73,7 +73,7 @@ # the default branch for upstream sources upstream-branch=upstream # the default branch for the debian patch - debian-branch=master + debian-branch=debian/latest [buildpackage] upstream-branch=dfsgclean @@ -130,7 +130,7 @@ $ export GBP_CONFI_FILES=/does/not/exist $ gbp config buildpackage.debian-branch - master + debian/latest diff --git a/docs/chapters/import.xml b/docs/chapters/import.xml index 8c34857c..3e585cba 100644 --- a/docs/chapters/import.xml +++ b/docs/chapters/import.xml @@ -119,13 +119,13 @@ by version number. gbp:info: Importing '../gif2apng-1.9.tar.gz' to branch 'upstream' (filtering out ["'CVS/*'", "'.bzr/*'", "'.hg/*'", "'.svn/*'"])... gbp:info: Source package is gif2apng gbp:info: Upstream version is 1.9 - gbp:info: Merging to 'master' + gbp:info: Merging to 'debian/latest' gbp:error: Automatic merge failed. gbp:error: Error detected, Will roll back changes. gbp:info: Rolling back branch upstream by resetting it to a6733c1f1e190ac0ed4774abc3466e9986a6df5e gbp:info: Rolling back branch pristine-tar by resetting it to 0ee24ac614c920e30af82d602882c2ee841c88e5 gbp:info: Rolling back tag upstream/1.9 by deleting it - gbp:info: Rolling back branch master by resetting it to ce99782336e83a56e8e579b3cdadf93b0c19e1a8 + gbp:info: Rolling back branch debian/latest by resetting it to ce99782336e83a56e8e579b3cdadf93b0c19e1a8 gbp:info: Rolling back failed merge of upstream/1.9 gbp:error: Rolled back changes after import error. @@ -179,7 +179,7 @@ EOF &gitcmd; branch upstream $(&gitcmd; log --format='%H' | tail -1) The important thing here is that the COMMIT_ID specifies a - point on the master branch that carried only the + point on the debian/latest branch that carried only the upstream sources and not the &debian; modifications. The above example assumes that this was the first commit to that repository. @@ -200,7 +200,7 @@ EOF git checkout upstream git rm . git commit 'Initial upstream branch.' - git checkout master + git checkout debian/latest # When not using 3.0 (quilt) with the default --merge-mode=auto git merge upstream @@ -425,7 +425,7 @@ upstream-tag = v%(version%.%_)s Branch layout - By default, &gbp; uses one branch to keep the &debian; packaging called master + By default, &gbp; uses one branch to keep the &debian; packaging called debian/latest and a branch to keep the upstream packaging called upstream. diff --git a/docs/chapters/intro.xml b/docs/chapters/intro.xml index 88c45a6c..24babe28 100644 --- a/docs/chapters/intro.xml +++ b/docs/chapters/intro.xml @@ -47,7 +47,7 @@ The (the default branch - name used in the &git; repository is master) holds + name used in the &git; repository is debian/latest) holds your current development work. That's the branch you usually cut your releases from and the default branch new upstream releases are merged onto. @@ -68,8 +68,8 @@ There can be one or more branches. Every patch-queue branch is related to a . If the is called - master, the corresponding patch-queue branch is - called patch-queue/master. The patch-queue branch is + debian/latest, the corresponding patch-queue branch is + called patch-queue/debian/latest. The patch-queue branch is the &debian; branch plus the contents of debian/patches applied. These branches are managed with &gbp-pq;. diff --git a/docs/chapters/special.xml b/docs/chapters/special.xml index 8e4ec3f4..8dd327e9 100644 --- a/docs/chapters/special.xml +++ b/docs/chapters/special.xml @@ -15,7 +15,7 @@ (by default named upstream) as usual and just don't merge to the debian-branch (by default named - master): + debian/latest): &gbp-import-orig; --no-merge /path/to/nondfsg-clean-package_10.4.orig.tar.gz @@ -35,7 +35,7 @@ cleanup-script.sh &gitcmd; commit -a -m "Make source dfsg clean" &gitcmd; tag 10.4.dfsg - &gitcmd; checkout master + &gitcmd; checkout debian/latest &gitcmd; pull . dfsg_clean @@ -44,21 +44,21 @@ Importing NMUs First, create a branch that holds the NMUs from the tip of your - (default is master) once: + (default is debian/latest) once: - &gitcmd; nmu master + &gitcmd; nmu debian/latest To import an NMU, change into the git repository and use &gbp-import-dsc;: - &gitcmd; checkout master + &gitcmd; checkout debian/latest &gbp-import-dsc; =nmu /path/to/package_1.0-1nmu0.dsc This will import the NMU onto the branched named nmu - instead of the default . This method can also + instead of the default . This method can also be used to import "old" releases into the &git; repository when migrating to &git; from another VCS. @@ -151,7 +151,7 @@ EOF This uses apt-get to download the source package, puts the orig tarball on the and the &debian; changes on the (by default - master). The second command + debian/latest). The second command creates a branch called debian. Now you can easily modify the package, revert changes you made, create other branches for testing, see what changes you made, etc. When finished, just do diff --git a/docs/manpages/gbp-buildpackage-rpm.xml b/docs/manpages/gbp-buildpackage-rpm.xml index 978cd8fd..e3105921 100644 --- a/docs/manpages/gbp-buildpackage-rpm.xml +++ b/docs/manpages/gbp-buildpackage-rpm.xml @@ -261,7 +261,7 @@ If you're not on this branch when invoking &gbp-buildpackage-rpm; it - will fail. Default is master. This is done + will fail. Default is debian/latest. This is done to make sure you don't accidentally release from a topic branch. Not being on this branch will be ignored when using . diff --git a/docs/manpages/gbp-buildpackage.xml b/docs/manpages/gbp-buildpackage.xml index 972aa318..a72168af 100644 --- a/docs/manpages/gbp-buildpackage.xml +++ b/docs/manpages/gbp-buildpackage.xml @@ -730,7 +730,7 @@ If you're not on this branch when invoking &gbp-buildpackage; it will - fail. Default is master. This is done to + fail. Default is debian/latest. This is done to make sure you don't accidentally release from a topic branch. Not being on this branch will be ignored when using . diff --git a/docs/manpages/gbp-clone.xml b/docs/manpages/gbp-clone.xml index 7c1404b4..4f4837c6 100644 --- a/docs/manpages/gbp-clone.xml +++ b/docs/manpages/gbp-clone.xml @@ -67,7 +67,7 @@ The branch in the Git repository the Debian package is being - developed on, default is master. + developed on, default is debian/latest. diff --git a/docs/manpages/gbp-config.xml b/docs/manpages/gbp-config.xml index 5adf7c96..24c1166f 100644 --- a/docs/manpages/gbp-config.xml +++ b/docs/manpages/gbp-config.xml @@ -79,7 +79,7 @@ $ gbp config buildpackage buildpackage.upstream-branch=upstream - buildpackage.debian-branch=master + buildpackage.debian-branch=debian/latest ... diff --git a/docs/manpages/gbp-create-remote-repo.xml b/docs/manpages/gbp-create-remote-repo.xml index 84e320c8..e8867361 100644 --- a/docs/manpages/gbp-create-remote-repo.xml +++ b/docs/manpages/gbp-create-remote-repo.xml @@ -103,7 +103,7 @@ The branch in the &git; repository the &debian; package is being - developed on, default is master. + developed on, default is debian/latest. diff --git a/docs/manpages/gbp-dch.xml b/docs/manpages/gbp-dch.xml index bb9574cb..ecb10ea8 100644 --- a/docs/manpages/gbp-dch.xml +++ b/docs/manpages/gbp-dch.xml @@ -155,7 +155,7 @@ The branch in the Git repository the Debian package is being - developed on, default is master. + developed on, default is debian/latest. diff --git a/docs/manpages/gbp-import-dsc.xml b/docs/manpages/gbp-import-dsc.xml index 73c16764..c9eded2a 100644 --- a/docs/manpages/gbp-import-dsc.xml +++ b/docs/manpages/gbp-import-dsc.xml @@ -96,7 +96,7 @@ The branch in the &git; repository the debian sources are put - onto. Default is master. + onto. Default is debian/latest. diff --git a/docs/manpages/gbp-import-orig.xml b/docs/manpages/gbp-import-orig.xml index dc2ce199..74635859 100644 --- a/docs/manpages/gbp-import-orig.xml +++ b/docs/manpages/gbp-import-orig.xml @@ -89,7 +89,7 @@ The sources are placed on the upstream branch (default: upstream), tagged and merged onto the - debian branch (default: master). This + debian branch (default: debian/latest). This is either done using plain git merge or by creating a new tree that consists of the new upstream version plus the debian/ @@ -178,7 +178,7 @@ The branch in the &git; repository the &debian; package is being - developed on, default is master. After + developed on, default is debian/latest. After importing the new sources on the upstream branch, &gbp-import-orig; will try to merge the new version onto this branch. diff --git a/docs/manpages/gbp-import-ref.xml b/docs/manpages/gbp-import-ref.xml index 72193890..6c7ef9bc 100644 --- a/docs/manpages/gbp-import-ref.xml +++ b/docs/manpages/gbp-import-ref.xml @@ -127,7 +127,7 @@ The branch in the &git; repository the &debian; package is being - developed on, default is master. + developed on, default is debian/latest. diff --git a/docs/manpages/gbp-import-srpm.xml b/docs/manpages/gbp-import-srpm.xml index 11f4acbf..695259ca 100644 --- a/docs/manpages/gbp-import-srpm.xml +++ b/docs/manpages/gbp-import-srpm.xml @@ -96,7 +96,7 @@ The branch in the &git; repository the packaging files are put - onto. Default is master. + onto. Default is debian/latest. diff --git a/docs/manpages/gbp-pq-rpm.xml b/docs/manpages/gbp-pq-rpm.xml index 9406aa33..e28c247b 100644 --- a/docs/manpages/gbp-pq-rpm.xml +++ b/docs/manpages/gbp-pq-rpm.xml @@ -50,8 +50,8 @@ &gbp-pq-rpm; makes it easy to do source code development on a separate development branch (patch-queue branch in Debian git-buildpackage terms). For example, if the packaging files would be stored in - master the associated development branch would - be development/master. + debian/latest the associated development branch would + be development/debian/latest. diff --git a/docs/manpages/gbp-pq.xml b/docs/manpages/gbp-pq.xml index 2bc9a20c..e985d844 100644 --- a/docs/manpages/gbp-pq.xml +++ b/docs/manpages/gbp-pq.xml @@ -51,8 +51,8 @@ 3.0 (quilt) source format. With &gbp-pq;, you can maintain the quilt patches that should be applied to a package on a separate branch called patch-queue branch. So if your &debian; package lives on - master, the associated patch-queue branch will be - called patch-queue/master. + debian/latest, the associated patch-queue branch will be + called patch-queue/debian/latest. See diff --git a/docs/manpages/gbp-pull.xml b/docs/manpages/gbp-pull.xml index 1662383d..12115f46 100644 --- a/docs/manpages/gbp-pull.xml +++ b/docs/manpages/gbp-pull.xml @@ -90,7 +90,7 @@ The branch in the Git repository the Debian package is being - developed on, default is master. + developed on, default is debian/latest. diff --git a/docs/manpages/gbp-rpm-ch.xml b/docs/manpages/gbp-rpm-ch.xml index e0f0d9d7..6de52b6b 100644 --- a/docs/manpages/gbp-rpm-ch.xml +++ b/docs/manpages/gbp-rpm-ch.xml @@ -91,7 +91,7 @@ The branch in the Git repository the package is being developed on, - default is master. + default is debian/latest. diff --git a/docs/manpages/gbp-tag.xml b/docs/manpages/gbp-tag.xml index e8a2e308..d6c4dc33 100644 --- a/docs/manpages/gbp-tag.xml +++ b/docs/manpages/gbp-tag.xml @@ -132,7 +132,7 @@ If you're not on this branch when invoking &gbp-tag; it will - fail. Default is master. This is done to + fail. Default is debian/latest. This is done to make sure you don't accidentally tag on the wrong branch. Not being on this branch will be ignored when using . diff --git a/docs/po/de.po b/docs/po/de.po index ee0bb86b..392bae7b 100644 --- a/docs/po/de.po +++ b/docs/po/de.po @@ -631,7 +631,7 @@ msgid "" " # the default branch for upstream sources\n" " upstream-branch=upstream\n" " # the default branch for the debian patch\n" -" debian-branch=master\n" +" debian-branch=debian/latest\n" "\n" " [buildpackage]\n" " upstream-branch=dfsgclean\n" @@ -906,13 +906,13 @@ msgid "" "\tgbp:info: Importing '../gif2apng-1.9.tar.gz' to branch 'upstream' (filtering out [\"'CVS/*'\", \"'.bzr/*'\", \"'.hg/*'\", \"'.svn/*'\"])...\n" "\tgbp:info: Source package is gif2apng\n" "\tgbp:info: Upstream version is 1.9\n" -"\tgbp:info: Merging to 'master'\n" +"\tgbp:info: Merging to 'debian/latest'\n" "\tgbp:error: Automatic merge failed.\n" "\tgbp:error: Error detected, Will roll back changes.\n" "\tgbp:info: Rolling back branch upstream by resetting it to a6733c1f1e190ac0ed4774abc3466e9986a6df5e\n" "\tgbp:info: Rolling back branch pristine-tar by resetting it to 0ee24ac614c920e30af82d602882c2ee841c88e5\n" "\tgbp:info: Rolling back tag upstream/1.9 by deleting it\n" -"\tgbp:info: Rolling back branch master by resetting it to ce99782336e83a56e8e579b3cdadf93b0c19e1a8\n" +"\tgbp:info: Rolling back branch debian/latest by resetting it to ce99782336e83a56e8e579b3cdadf93b0c19e1a8\n" "\tgbp:info: Rolling back failed merge of upstream/1.9\n" "\tgbp:error: Rolled back changes after import error.\n" " " @@ -993,7 +993,7 @@ msgid "" "that point. So use &gitkcmd; or &gitcmd;-log to locate the commit-id of that " "commit and create the upstream branch from there, e.g.: The important thing here is that the " -"COMMIT_ID specifies a point on the master branch that carried " +"COMMIT_ID specifies a point on the debian/latest branch that carried " "only the upstream sources and not the &debian; " "modifications. The above example assumes that this was the first commit to " "that repository." @@ -1024,7 +1024,7 @@ msgid "" " git checkout upstream\n" " git rm .\n" " git commit 'Initial upstream branch.'\n" -" git checkout master\n" +" git checkout debian/latest\n" " # When not using 3.0 (quilt) with the default --merge-mode=auto\n" " git merge upstream\n" msgstr "" @@ -1356,7 +1356,7 @@ msgstr "" #: chapters/import.xml:428 msgid "" "By default, &gbp; uses one branch to keep the &debian; packaging called " -"master and a branch to keep the upstream packaging " +"debian/latest and a branch to keep the upstream packaging " "called upstream." msgstr "" @@ -1535,7 +1535,7 @@ msgstr "" #: chapters/intro.xml:49 msgid "" "The (the default branch name used in the " -"&git; repository is master) holds your current " +"&git; repository is debian/latest) holds your current " "development work. That's the branch you usually cut your releases from and " "the default branch new upstream releases are merged onto." msgstr "" @@ -1564,8 +1564,8 @@ msgstr "" msgid "" "There can be one or more branches. Every patch-" "queue branch is related to a . If the " -" is called master, the " -"corresponding patch-queue branch is called patch-queue/masterdebian-branch is called debian/latest, the " +"corresponding patch-queue branch is called patch-queue/debian/latest. The patch-queue branch is the &debian; branch plus the contents " "of debian/patches applied. These branches are managed " "with &gbp-pq;." @@ -2513,7 +2513,7 @@ msgid "" "upstream version, you import the new version on the (by default debian/latest). The second command creates a branch called debian. Now you can easily modify the package, revert changes you made, " "create other branches for testing, see what changes you made, etc. When " @@ -3198,7 +3198,7 @@ msgstr "" #: manpages/gbp-buildpackage-rpm.xml:263 msgid "" "If you're not on this branch when invoking &gbp-buildpackage-rpm; it will " -"fail. Default is master. This is done to make " +"fail. Default is debian/latest. This is done to make " "sure you don't accidentally release from a topic branch. Not being on this " "branch will be ignored when using ." msgstr "" @@ -4372,7 +4372,7 @@ msgstr "" #: manpages/gbp-buildpackage.xml:732 msgid "" "If you're not on this branch when invoking &gbp-buildpackage; it will fail. " -"Default is master. This is done to make sure you " +"Default is debian/latest. This is done to make sure you " "don't accidentally release from a topic branch. Not being on this branch " "will be ignored when using ." msgstr "" @@ -4568,7 +4568,7 @@ msgstr "" #: manpages/gbp-clone.xml:67 manpages/gbp-dch.xml:157 manpages/gbp-pull.xml:92 msgid "" "The branch in the Git repository the Debian package is being developed on, " -"default is master." +"default is debian/latest." msgstr "" #. type: Content of: @@ -4887,7 +4887,7 @@ msgstr "" msgid "" " $ gbp config buildpackage\n" " buildpackage.upstream-branch=upstream\n" -" buildpackage.debian-branch=master\n" +" buildpackage.debian-branch=debian/latest\n" " ..." msgstr "" @@ -5374,7 +5374,7 @@ msgstr "" #: manpages/gbp-create-remote-repo.xml:105 manpages/gbp-import-ref.xml:129 msgid "" "The branch in the &git; repository the &debian; package is being developed " -"on, default is master." +"on, default is debian/latest." msgstr "" #. type: Content of: @@ -6491,7 +6491,7 @@ msgstr "" #: manpages/gbp-import-dsc.xml:98 msgid "" "The branch in the &git; repository the debian sources are put onto. Default " -"is master." +"is debian/latest." msgstr "" #. type: Content of: @@ -6800,7 +6800,7 @@ msgstr "" msgid "" "The sources are placed on the upstream branch (default: " "upstream), tagged and merged onto the debian " -"branch (default: master). This is either done " +"branch (default: debian/latest). This is either done " "using plain git merge or by creating a new tree that " "consists of the new upstream version plus the debian/ " "directory. The later is used for source format 3.0 (quilt) packages since " @@ -6886,7 +6886,7 @@ msgstr "" #: manpages/gbp-import-orig.xml:174 msgid "" "The branch in the &git; repository the &debian; package is being developed " -"on, default is master. After importing the new " +"on, default is debian/latest. After importing the new " "sources on the upstream branch, &gbp-import-orig; will try to merge the new " "version onto this branch." msgstr "" @@ -7363,7 +7363,7 @@ msgstr "" #: manpages/gbp-import-srpm.xml:98 msgid "" "The branch in the &git; repository the packaging files are put onto. Default " -"is master." +"is debian/latest." msgstr "" #. type: Content of: @@ -7515,9 +7515,9 @@ msgstr "" msgid "" "&gbp-pq-rpm; makes it easy to do source code development on a separate " "development branch (patch-queue branch in Debian git-buildpackage terms). " -"For example, if the packaging files would be stored in masterdebian/latest the associated development branch would be " -"development/master." +"development/debian/latest." msgstr "" #. type: Content of: @@ -7785,9 +7785,9 @@ msgid "" "maintained with &gbp;. This is especially useful with packages using the 3.0 " "(quilt) source format. With &gbp-pq;, you can maintain the quilt patches " "that should be applied to a package on a separate branch called patch-queue " -"branch. So if your &debian; package lives on <replaceable>master</" +"branch. So if your &debian; package lives on <replaceable>debian/latest</" "replaceable>, the associated patch-queue branch will be called " -"<replaceable>patch-queue/master</replaceable>." +"<replaceable>patch-queue/debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><para> @@ -8469,7 +8469,7 @@ msgstr "" #: manpages/gbp-rpm-ch.xml:93 msgid "" "The branch in the Git repository the package is being developed on, default " -"is <replaceable>master</replaceable>." +"is <replaceable>debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -8865,7 +8865,7 @@ msgstr "" #: manpages/gbp-tag.xml:134 msgid "" "If you're not on this branch when invoking &gbp-tag; it will fail. Default " -"is <replaceable>master</replaceable>. This is done to make sure you don't " +"is <replaceable>debian/latest</replaceable>. This is done to make sure you don't " "accidentally tag on the wrong branch. Not being on this branch will be " "ignored when using <option>--ignore-branch</option>." msgstr "" diff --git a/docs/po/gbp.pot b/docs/po/gbp.pot index dcba81a2..dc54a114 100644 --- a/docs/po/gbp.pot +++ b/docs/po/gbp.pot @@ -672,7 +672,7 @@ msgid "" " # the default branch for upstream sources\n" " upstream-branch=upstream\n" " # the default branch for the debian patch\n" -" debian-branch=master\n" +" debian-branch=debian/latest\n" "\n" " [buildpackage]\n" " upstream-branch=dfsgclean\n" @@ -955,7 +955,7 @@ msgid "" "(filtering out [\"'CVS/*'\", \"'.bzr/*'\", \"'.hg/*'\", \"'.svn/*'\"])...\n" "\tgbp:info: Source package is gif2apng\n" "\tgbp:info: Upstream version is 1.9\n" -"\tgbp:info: Merging to 'master'\n" +"\tgbp:info: Merging to 'debian/latest'\n" "\tgbp:error: Automatic merge failed.\n" "\tgbp:error: Error detected, Will roll back changes.\n" "\tgbp:info: Rolling back branch upstream by resetting it to " @@ -963,7 +963,7 @@ msgid "" "\tgbp:info: Rolling back branch pristine-tar by resetting it to " "0ee24ac614c920e30af82d602882c2ee841c88e5\n" "\tgbp:info: Rolling back tag upstream/1.9 by deleting it\n" -"\tgbp:info: Rolling back branch master by resetting it to " +"\tgbp:info: Rolling back branch debian/latest by resetting it to " "ce99782336e83a56e8e579b3cdadf93b0c19e1a8\n" "\tgbp:info: Rolling back failed merge of upstream/1.9\n" "\tgbp:error: Rolled back changes after import error.\n" @@ -1046,7 +1046,7 @@ msgid "" "that point. So use &gitkcmd; or &gitcmd;-log to locate the commit-id of that " "commit and create the upstream branch from there, e.g.: <placeholder " "type=\"programlisting\" id=\"0\"/> The important thing here is that the " -"<envar>COMMIT_ID</envar> specifies a point on the master branch that carried " +"<envar>COMMIT_ID</envar> specifies a point on the debian/latest branch that carried " "<emphasis>only</emphasis> the upstream sources and not the &debian; " "modifications. The above example assumes that this was the first commit to " "that repository." @@ -1082,7 +1082,7 @@ msgid "" " <command>git commit</command> <option>--allow-empty</option> " "<option>-m</option> <replaceable>'Initial upstream branch.'</replaceable>\n" " <command>git checkout</command> <option>-f</option> " -"<replaceable>master</replaceable>\n" +"<replaceable>debian/latest</replaceable>\n" " # When not using 3.0 (quilt) with the default --merge-mode=auto\n" " <command>git merge</command> <option>--allow-unrelated-histories</option> " "<replaceable>upstream</replaceable>\n" @@ -1426,7 +1426,7 @@ msgstr "" #: chapters/import.xml:428 msgid "" "By default, &gbp; uses one branch to keep the &debian; packaging called " -"<emphasis>master</emphasis> and a branch to keep the upstream packaging " +"<emphasis>debian/latest</emphasis> and a branch to keep the upstream packaging " "called <emphasis>upstream</emphasis>." msgstr "" @@ -1604,7 +1604,7 @@ msgstr "" #: chapters/intro.xml:49 msgid "" "The <option>debian-branch</option> (the default branch name used in the " -"&git; repository is <emphasis>master</emphasis>) holds your current " +"&git; repository is <emphasis>debian/latest</emphasis>) holds your current " "development work. That's the branch you usually cut your releases from and " "the default branch new upstream releases are merged onto." msgstr "" @@ -1633,9 +1633,9 @@ msgstr "" msgid "" "There can be one or more <option>patch-queue</option> branches. Every " "patch-queue branch is related to a <option>debian-branch</option>. If the " -"<option>debian-branch</option> is called <emphasis>master</emphasis>, the " +"<option>debian-branch</option> is called <emphasis>debian/latest</emphasis>, the " "corresponding patch-queue branch is called " -"<emphasis>patch-queue/master</emphasis>. The patch-queue branch is the " +"<emphasis>patch-queue/debian/latest</emphasis>. The patch-queue branch is the " "&debian; branch plus the contents of <emphasis>debian/patches</emphasis> " "applied. These branches are managed with &gbp-pq;." msgstr "" @@ -2600,7 +2600,7 @@ msgid "" "<option>upstream-branch</option> (by default named " "<emphasis>upstream</emphasis>) as usual and just don't merge to the " "<emphasis>debian-branch</emphasis> (by default named " -"<emphasis>master</emphasis>):" +"<emphasis>debian/latest</emphasis>):" msgstr "" #. type: Content of: <chapter><sect1><programlisting> @@ -2641,7 +2641,7 @@ msgid "" " cleanup-script.sh\n" " &gitcmd; commit -a -m \"Make source dfsg clean\"\n" " &gitcmd; tag <replaceable>10.4.dfsg</replaceable>\n" -" &gitcmd; checkout <replaceable>master</replaceable>\n" +" &gitcmd; checkout <replaceable>debian/latest</replaceable>\n" " &gitcmd; pull <replaceable>.</replaceable> " "<replaceable>dfsg_clean</replaceable>\n" msgstr "" @@ -2655,7 +2655,7 @@ msgstr "" #: chapters/special.xml:46 msgid "" "First, create a branch that holds the NMUs from the tip of your " -"<option>debian-branch</option> (default is <emphasis>master</emphasis>) " +"<option>debian-branch</option> (default is <emphasis>debian/latest</emphasis>) " "once:" msgstr "" @@ -2664,7 +2664,7 @@ msgstr "" #, no-wrap msgid "" " &gitcmd; <option>branch</option> <replaceable>nmu</replaceable> " -"<replaceable>master</replaceable>\n" +"<replaceable>debian/latest</replaceable>\n" msgstr "" #. type: Content of: <chapter><sect1><para> @@ -2676,7 +2676,7 @@ msgstr "" #: chapters/special.xml:56 #, no-wrap msgid "" -" &gitcmd; checkout <replaceable>master</replaceable>\n" +" &gitcmd; checkout <replaceable>debian/latest</replaceable>\n" " &gbp-import-dsc; " "<option>--debian-branch</option>=<replaceable>nmu</replaceable> " "<filename>/path/to/package_1.0-1nmu0.dsc</filename>\n" @@ -2686,7 +2686,7 @@ msgstr "" #: chapters/special.xml:60 msgid "" "This will import the NMU onto the branched named <emphasis>nmu</emphasis> " -"instead of the default <option>master</option>. This method can also be used " +"instead of the default <option>debian/latest</option>. This method can also be used " "to import \"old\" releases into the &git; repository when migrating to &git; " "from another VCS." msgstr "" @@ -2826,7 +2826,7 @@ msgid "" "This uses <command>apt-get</command> to download the source package, puts " "the orig tarball on the <option>upstream-branch</option> and the &debian; " "changes on the <option>debian-branch</option> (by default " -"<emphasis>master</emphasis>). The second command creates a branch called " +"<emphasis>debian/latest</emphasis>). The second command creates a branch called " "<emphasis>debian</emphasis>. Now you can easily modify the package, revert " "changes you made, create other branches for testing, see what changes you " "made, etc. When finished, just do" @@ -3295,7 +3295,7 @@ msgstr "" #: manpages/gbp-buildpackage-rpm.xml:263 msgid "" "If you're not on this branch when invoking &gbp-buildpackage-rpm; it will " -"fail. Default is <replaceable>master</replaceable>. This is done to make " +"fail. Default is <replaceable>debian/latest</replaceable>. This is done to make " "sure you don't accidentally release from a topic branch. Not being on this " "branch will be ignored when using <option>--git-ignore-new</option>." msgstr "" @@ -4462,7 +4462,7 @@ msgstr "" #: manpages/gbp-buildpackage.xml:732 msgid "" "If you're not on this branch when invoking &gbp-buildpackage; it will " -"fail. Default is <replaceable>master</replaceable>. This is done to make " +"fail. Default is <replaceable>debian/latest</replaceable>. This is done to make " "sure you don't accidentally release from a topic branch. Not being on this " "branch will be ignored when using <option>--git-ignore-new</option>." msgstr "" @@ -4661,7 +4661,7 @@ msgstr "" #: manpages/gbp-clone.xml:67 manpages/gbp-dch.xml:157 manpages/gbp-pull.xml:92 msgid "" "The branch in the Git repository the Debian package is being developed on, " -"default is <replaceable>master</replaceable>." +"default is <replaceable>debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> @@ -4982,7 +4982,7 @@ msgstr "" msgid "" " $ gbp config buildpackage\n" " buildpackage.upstream-branch=upstream\n" -" buildpackage.debian-branch=master\n" +" buildpackage.debian-branch=debian/latest\n" " ..." msgstr "" @@ -5472,7 +5472,7 @@ msgstr "" #: manpages/gbp-create-remote-repo.xml:105 manpages/gbp-import-ref.xml:129 msgid "" "The branch in the &git; repository the &debian; package is being developed " -"on, default is <replaceable>master</replaceable>." +"on, default is <replaceable>debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -6591,7 +6591,7 @@ msgstr "" #: manpages/gbp-import-dsc.xml:98 msgid "" "The branch in the &git; repository the debian sources are put onto. Default " -"is <replaceable>master</replaceable>." +"is <replaceable>debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> @@ -6906,7 +6906,7 @@ msgstr "" msgid "" "The sources are placed on the upstream branch (default: " "<replaceable>upstream</replaceable>), tagged and merged onto the debian " -"branch (default: <replaceable>master</replaceable>). This is either done " +"branch (default: <replaceable>debian/latest</replaceable>). This is either done " "using plain <command>git merge</command> or by creating a new tree that " "consists of the new upstream version plus the <filename>debian/</filename> " "directory. The later is used for source format 3.0 (quilt) packages since " @@ -6991,7 +6991,7 @@ msgstr "" #: manpages/gbp-import-orig.xml:174 msgid "" "The branch in the &git; repository the &debian; package is being developed " -"on, default is <replaceable>master</replaceable>. After importing the new " +"on, default is <replaceable>debian/latest</replaceable>. After importing the new " "sources on the upstream branch, &gbp-import-orig; will try to merge the new " "version onto this branch." msgstr "" @@ -7468,7 +7468,7 @@ msgstr "" #: manpages/gbp-import-srpm.xml:98 msgid "" "The branch in the &git; repository the packaging files are put onto. Default " -"is <replaceable>master</replaceable>." +"is <replaceable>debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><term> @@ -7622,8 +7622,8 @@ msgid "" "&gbp-pq-rpm; makes it easy to do source code development on a separate " "development branch (patch-queue branch in Debian git-buildpackage terms). " "For example, if the packaging files would be stored in " -"<replaceable>master</replaceable> the associated development branch would be " -"<replaceable>development/master</replaceable>." +"<replaceable>debian/latest</replaceable> the associated development branch would be " +"<replaceable>development/debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><title> @@ -7892,8 +7892,8 @@ msgid "" "(quilt) source format. With &gbp-pq;, you can maintain the quilt patches " "that should be applied to a package on a separate branch called patch-queue " "branch. So if your &debian; package lives on " -"<replaceable>master</replaceable>, the associated patch-queue branch will be " -"called <replaceable>patch-queue/master</replaceable>." +"<replaceable>debian/latest</replaceable>, the associated patch-queue branch will be " +"called <replaceable>patch-queue/debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><para> @@ -8583,7 +8583,7 @@ msgstr "" #: manpages/gbp-rpm-ch.xml:93 msgid "" "The branch in the Git repository the package is being developed on, default " -"is <replaceable>master</replaceable>." +"is <replaceable>debian/latest</replaceable>." msgstr "" #. type: Content of: <refentry><refsect1><variablelist><varlistentry><listitem><para> @@ -8979,7 +8979,7 @@ msgstr "" #: manpages/gbp-tag.xml:134 msgid "" "If you're not on this branch when invoking &gbp-tag; it will fail. Default " -"is <replaceable>master</replaceable>. This is done to make sure you don't " +"is <replaceable>debian/latest</replaceable>. This is done to make sure you don't " "accidentally tag on the wrong branch. Not being on this branch will be " "ignored when using <option>--ignore-branch</option>." msgstr "" diff --git a/gbp.conf b/gbp.conf index 877db84c..c6a71e30 100644 --- a/gbp.conf +++ b/gbp.conf @@ -8,7 +8,7 @@ # the default branch for upstream sources: #upstream-branch = upstream # the default branch for the debian patch: -#debian-branch = master +#debian-branch = debian/latest # the default tag formats used: #upstream-tag = upstream/%(version)s #debian-tag = debian/%(version)s @@ -138,4 +138,3 @@ remote-url-pattern = ssh://git.debian.org/git/pkg-libvirt/%(pkg)s # Template dir to passed to git-init template-dir = /srv/alioth.debian.org/chroot/home/groups/pkg-libvirt/git-template - diff --git a/gbp/config.py b/gbp/config.py index 91b852e9..36be9ff2 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -126,7 +126,7 @@ class GbpOptionParser(OptionParser): 'create-missing-branches': 'False', 'customizations': '', 'dch-opt': [], - 'debian-branch': 'master', + 'debian-branch': 'debian/latest', 'debian-tag': 'debian/%(version)s', 'debian-tag-msg': '%(pkg)s Debian release %(version)s', 'defuse-gitattributes': 'auto', @@ -812,7 +812,7 @@ class GbpOptionParserRpm(GbpOptionParser): defaults.update({ 'tmp-dir': '/var/tmp/gbp/', 'vendor': 'Downstream', - 'packaging-branch': 'master', + 'packaging-branch': 'debian/latest', 'packaging-dir': '', 'packaging-tag-msg': '%(pkg)s (vendor)s release %(version)s', 'packaging-tag': 'packaging/%(version)s', diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index f8677181..d625e493 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -212,12 +212,12 @@ def get_pbuilder_dist(options, repo, native=False): if len(parts) == 2: # e.g. debian/stretch suite = parts[1] if vendor == parts[0]: - dist = '' if suite in ['sid', 'master', 'main', 'latest'] else suite + dist = '' if suite in ['sid', 'debian/latest', 'master', 'main', 'latest'] else suite else: dist = '%s_%s' % (parts[0], suite) # Branches in Debian often omit the debian/ prefix elif len(parts) == 1 and vendor.lower() == "debian": - if branch in ['master', 'sid']: + if branch in ['debian/latest', 'sid']: dist = '' elif branch in du.Releases: dist = branch diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py index 1a80ec05..25216d03 100644 --- a/gbp/scripts/common/pq.py +++ b/gbp/scripts/common/pq.py @@ -51,8 +51,8 @@ def pq_branch_name(branch): """ get the patch queue branch corresponding to branch - >>> pq_branch_name("patch-queue/master") - 'patch-queue/master' + >>> pq_branch_name("patch-queue/debian/latest") + 'patch-queue/debian/latest' >>> pq_branch_name("foo") 'patch-queue/foo' """ @@ -66,8 +66,8 @@ def pq_branch_base(branch): """ get the branch corresponding to the given patch queue branch - >>> pq_branch_base("patch-queue/master") - 'master' + >>> pq_branch_base("patch-queue/debian/latest") + 'debian/latest' >>> pq_branch_base("foo") 'foo' """ diff --git a/tests/03_test_dch_guess_version.py b/tests/03_test_dch_guess_version.py index 37f6da35..eb97791a 100644 --- a/tests/03_test_dch_guess_version.py +++ b/tests/03_test_dch_guess_version.py @@ -23,7 +23,7 @@ def test_guess_no_epoch(self): tag = self.repo.version_to_tag(tagformat, uversion) self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion, sign=False) - self.repo.set_branch("master") + self.repo.set_branch("debian/latest") guessed = dch.guess_version_from_upstream(self.repo, tagformat, upstream_branch, @@ -44,7 +44,7 @@ def test_guess_epoch(self): self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion, sign=False) - self.repo.set_branch("master") + self.repo.set_branch("debian/latest") guessed = dch.guess_version_from_upstream(self.repo, tagformat, upstream_branch, @@ -65,7 +65,7 @@ def test_guess_upstream_tag_clash_with_non_upstream_tag(self): tag = self.repo.version_to_tag(tagformat, uversion) self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion, sign=False) - self.repo.set_branch("master") + self.repo.set_branch("debian/latest") self.add_file("clash", "bar") self.repo.create_tag("vyatta/something", msg="some non-upstream tag but not package release tag either") self.add_file("clash2", "bar") @@ -90,7 +90,7 @@ def test_guess_upstream_tag_zero_release(self): tag = self.repo.version_to_tag(tagformat, uversion) self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion, sign=False) - self.repo.set_branch('master') + self.repo.set_branch('debian/latest') self.add_file('doesnot2', 'matter') guessed = dch.guess_version_from_upstream(self.repo, @@ -111,7 +111,7 @@ def test_guess_mangled_upstream_tag(self): tag = self.repo.version_to_tag(tagformat, uversion) self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion, sign=False) - self.repo.set_branch("master") + self.repo.set_branch("debian/latest") guessed = dch.guess_version_from_upstream(self.repo, tagformat, upstream_branch, @@ -128,7 +128,7 @@ def test_no_changelog(self): tag = self.repo.version_to_tag(tagformat, uversion) self.repo.create_tag(name=tag, msg="Upstream release %s" % uversion, sign=False) - self.repo.set_branch("master") + self.repo.set_branch("debian/latest") guessed = dch.guess_version_from_upstream(self.repo, tagformat, upstream_branch, diff --git a/tests/04_test_submodules.py b/tests/04_test_submodules.py index 5e097694..33fc9660 100644 --- a/tests/04_test_submodules.py +++ b/tests/04_test_submodules.py @@ -104,7 +104,7 @@ def test_has_submodules(): def test_get_submodules(): """Check for submodules list of (name, hash)""" - modules = REPO.get_submodules("master")[0] + modules = REPO.get_submodules("debian/latest")[0] eq_(modules[0], 'test_submodule') eq_(len(modules[1]), 40) @@ -113,7 +113,7 @@ def test_dump_tree(): """Dump the repository and check if files exist""" dumpdir = TMPDIR.join("dump") os.mkdir(dumpdir) - ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True)) + ok_(buildpackage.dump_tree(REPO, dumpdir, "debian/latest", True)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(os.path.exists(os.path.join(dumpdir, TESTDIR_NAME, TESTFILE_NAME))) ok_(os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name, @@ -121,7 +121,7 @@ def test_dump_tree(): # No submodules or subdirs if recursive is False dumpdir = TMPDIR.join("dump2") os.mkdir(dumpdir) - ok_(buildpackage.dump_tree(REPO, dumpdir, "master", True, False)) + ok_(buildpackage.dump_tree(REPO, dumpdir, "debian/latest", True, False)) ok_(os.path.exists(os.path.join(dumpdir, TESTFILE_NAME))) ok_(not os.path.exists(os.path.join(dumpdir, TESTDIR_NAME))) ok_(not os.path.exists(os.path.join(dumpdir, SUBMODULES[0].name))) @@ -186,9 +186,9 @@ def test_add_whitespace_submodule(): def test_get_more_submodules(): """Check for submodules list of (name, hash)""" - module = REPO.get_submodules("master") + module = REPO.get_submodules("debian/latest") eq_(len(module), len(SUBMODULE_NAMES)) - for module in REPO.get_submodules("master"): + for module in REPO.get_submodules("debian/latest"): eq_(len(module[1]), 40) ok_(os.path.basename(module[0]) in SUBMODULE_NAMES) diff --git a/tests/07_test_fastimport.py b/tests/07_test_fastimport.py index c3ca8188..7c8efd6e 100644 --- a/tests/07_test_fastimport.py +++ b/tests/07_test_fastimport.py @@ -36,7 +36,7 @@ def test_init_fastimport(): def test_add_file(): """Add a file via fastimport""" author = repo.get_author_info() - fastimport.start_commit('master', author, "a commit") + fastimport.start_commit('debian/latest', author, "a commit") fastimport.deleteall() testfile = os.path.join(repo.path, '.git', 'description') fastimport.add_file(b'./testfile', @@ -47,7 +47,7 @@ def test_add_file(): def test_add_symlink(): """Add a symbolic link via fastimport""" author = repo.get_author_info() - fastimport.start_commit('master', author, "a 2nd commit") + fastimport.start_commit('debian/latest', author, "a 2nd commit") fastimport.add_symlink(tl_name, tf_name) @@ -56,7 +56,7 @@ def test_close(): def test_result(): - repo.force_head('master', hard=True) + repo.force_head('debian/latest', hard=True) testfile = os.path.join(repo.path, tf_name) testlink = os.path.join(repo.path, tl_name) diff --git a/tests/10_test_get_upstream_tree.py b/tests/10_test_get_upstream_tree.py index cd650576..61e88786 100644 --- a/tests/10_test_get_upstream_tree.py +++ b/tests/10_test_get_upstream_tree.py @@ -43,7 +43,7 @@ def test_invalid_upstream_branch(self): def test_valid_tree(self): """Get upstream tree from a valid upstream tree""" self.add_file('foo') - tree = self.repo.rev_parse('master') + tree = self.repo.rev_parse('debian/latest') options = MockOptions(upstream_tree=tree) t = export_orig.git_archive_get_upstream_tree(self.repo, None, options) self.assertEqual(t, tree) @@ -58,7 +58,7 @@ def test_invalid_tree(self): def test_valid_tag(self): """Get upstream tree from a valid tag""" self.add_file('foo') - self.repo.rev_parse('master') + self.repo.rev_parse('debian/latest') self.repo.create_tag('upstream/1.0_rc3') options = MockOptions(upstream_tree="TAG", upstream_tag="upstream/%(version)s") diff --git a/tests/13_test_gbp_pq.py b/tests/13_test_gbp_pq.py index dc53c260..06f5c851 100644 --- a/tests/13_test_gbp_pq.py +++ b/tests/13_test_gbp_pq.py @@ -120,8 +120,8 @@ def test_apply_single_patch(self): patch = gbp.patch_series.Patch(_patch_path('foo.patch')) - self.repo.create_branch(pq.pq_branch_name('master')) - pq.apply_single_patch(self.repo, 'master', patch, None) + self.repo.create_branch(pq.pq_branch_name('debian/latest')) + pq.apply_single_patch(self.repo, 'debian/latest', patch, None) self.assertIn(b'foo', self.repo.list_files()) @@ -158,7 +158,7 @@ def _test_generate_patches(self, changes, expected_patches, opts): for expected in expected_paths: self.repo.apply_patch(expected) self.repo.commit_all("foo") - diff = self.repo.diff('master', 'testapply') + diff = self.repo.diff('debian/latest', 'testapply') # Branches must be identical afterwards self.assertEqual(b'', diff) @@ -241,7 +241,7 @@ def test_drop(self): opts = TestExport.Options() opts.drop = True - repo.create_branch(pq.pq_branch_name('master')) + repo.create_branch(pq.pq_branch_name('debian/latest')) switch_pq(repo, start, opts) self.assertEqual(repo.get_branch(), pq_branch) export_patches(repo, pq_branch, opts) @@ -255,7 +255,7 @@ def test_commit(self): pq_branch = os.path.join('patch-queue', start) opts = TestExport.Options() opts.commit = True - repo.create_branch(pq.pq_branch_name('master')) + repo.create_branch(pq.pq_branch_name('debian/latest')) switch_pq(repo, start, opts) self.assertEqual(len(repo.get_commits()), 1) self.assertEqual(repo.get_branch(), pq_branch) @@ -284,7 +284,7 @@ def test_commit_dropped_patches(self): f.write("patch2.diff\n") repo.add_files('debian/patches') repo.commit_all('Add series file') - repo.create_branch(pq.pq_branch_name('master')) + repo.create_branch(pq.pq_branch_name('debian/latest')) switch_pq(repo, start, opts) self.assertEqual(len(repo.get_commits()), 2) self.assertEqual(repo.get_branch(), pq_branch) @@ -352,7 +352,7 @@ def setUp(self): self.git_create_empty_branch('bar') self.add_file('foo', 'foo') self.repo.create_tag('upstream/0.0.1') - self.repo.set_branch('master') + self.repo.set_branch('debian/latest') def test_empty(self): @@ -365,7 +365,7 @@ def test_empty(self): upstream_tag=TestFromTAG.Options.upstream_tag) diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1') self.assertEqual(b'', diff) - diff = self.repo.diff(self.repo.get_branch(), 'master') + diff = self.repo.diff(self.repo.get_branch(), 'debian/latest') self.assertNotEqual(b'', diff) rebase_pq(self.repo, @@ -373,7 +373,7 @@ def test_empty(self): options=TestFromTAG.Options) diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1') self.assertEqual(b'', diff) - diff = self.repo.diff(self.repo.get_branch(), 'master') + diff = self.repo.diff(self.repo.get_branch(), 'debian/latest') self.assertNotEqual(b'', diff) export_patches(self.repo, @@ -397,7 +397,7 @@ def test_adding_patch(self): self.assertTrue(os.path.exists(os.path.join(self.repo.path, os.path.dirname(SERIES_FILE), 'added-bar.patch'))) - switch_pq(self.repo, 'master', TestFromTAG.Options) + switch_pq(self.repo, 'debian/latest', TestFromTAG.Options) rebase_pq(self.repo, branch=self.repo.get_branch(), options=TestFromTAG.Options()) @@ -409,9 +409,9 @@ def test_adding_patch(self): 'added-bar.patch'))) # New upstream release self.repo.set_branch('bar') - GitCommand('cherry-pick', cwd=self.repo.path)(['patch-queue/master']) + GitCommand('cherry-pick', cwd=self.repo.path)(['patch-queue/debian/latest']) self.repo.create_tag('upstream/0.0.2') - self.repo.set_branch('master') + self.repo.set_branch('debian/latest') self.add_file( 'debian/changelog', 'foo (0.0.2-1) UNRELEASED; urgency=medium\n' @@ -421,7 +421,7 @@ def test_adding_patch(self): ' -- Mr. T. S. <t@example.com> ' 'Thu, 01 Jan 1970 00:00:00 +0000\n' ) - switch_pq(self.repo, 'master', TestFromTAG.Options()) + switch_pq(self.repo, 'debian/latest', TestFromTAG.Options()) rebase_pq(self.repo, branch=self.repo.get_branch(), options=TestFromTAG.Options()) diff --git a/tests/22_test_gbp_buildpackage.py b/tests/22_test_gbp_buildpackage.py index 9f7eca6a..631855e3 100644 --- a/tests/22_test_gbp_buildpackage.py +++ b/tests/22_test_gbp_buildpackage.py @@ -35,7 +35,7 @@ def test_get_pbuilder_dist_dep14_debian_sid(self, patch): @patch('gbp.deb.get_vendor', return_value='Debian') def test_get_pbuilder_dist_dep14_debian_master(self, patch): - branch = 'debian/master' + branch = 'debian/debian/latest' self.repo.create_branch(branch) self.repo.set_branch(branch) self.assertEqual(get_pbuilder_dist(self.options, self.repo), '') diff --git a/tests/24_test_gbp_import_orig.py b/tests/24_test_gbp_import_orig.py index 0f36820d..2b30ba6c 100644 --- a/tests/24_test_gbp_import_orig.py +++ b/tests/24_test_gbp_import_orig.py @@ -47,7 +47,7 @@ def setUp(self): os.makedirs('debian/source/') def test_30_quilt(self): - options = self.Options(debian_branch='master') + options = self.Options(debian_branch='debian/latest') with open(self.format_file, 'w') as f: f.write('3.0 (quilt)\n') self.repo.add_files([self.format_file]) @@ -56,23 +56,23 @@ def test_30_quilt(self): self.assertTrue(is_30_quilt(self.repo, options)) def test_no_format(self): - options = self.Options(debian_branch='master') + options = self.Options(debian_branch='debian/latest') self.assertFalse(os.path.exists(self.format_file)) self.assertFalse(is_30_quilt(self.repo, options)) def test_no_quilt(self): - options = self.Options(debian_branch='master') + options = self.Options(debian_branch='debian/latest') with open(self.format_file, 'w') as f: f.write('3.0 (nonexistent)') self.assertFalse(is_30_quilt(self.repo, options)) def test_30_quilt_empty_repo(self): - options = self.Options(debian_branch='master') + options = self.Options(debian_branch='debian/latest') self.assertFalse(is_30_quilt(self.repo, options)) class TestMergeModeReplace(DebianGitTestRepo): - debian_branch = 'master' + debian_branch = 'debian/latest' def setUp(self): DebianGitTestRepo.setUp(self) @@ -85,7 +85,7 @@ def testDebianDir(self): self.repo.set_branch("upstream") self.add_file("upstream_file") self.add_file("debian/changelog") - self.repo.set_branch("master") + self.repo.set_branch("debian/latest") self.repo.create_tag('upstream/1.0', "Upstream 1.0", "upstream") debian_branch_merge_by_replace(self.repo, "upstream/1.0", "1.0", self) self.assertTrue(os.path.exists("debian/control")) diff --git a/tests/28_test_gbp_git_repository_commit_dir.py b/tests/28_test_gbp_git_repository_commit_dir.py index 7fcea51d..f4f213ec 100644 --- a/tests/28_test_gbp_git_repository_commit_dir.py +++ b/tests/28_test_gbp_git_repository_commit_dir.py @@ -17,9 +17,9 @@ def setUp(self): def test_simple(self): self.repo.commit_dir(self.content, 'new content', - 'master', + 'debian/latest', create_missing_branch=True) - self.assertEquals(self.repo.show('master:file1'), b'content1') + self.assertEquals(self.repo.show('debian/latest:file1'), b'content1') def test_long_reflog(self): """Make sure we fail on onverly long msg resulting in an @@ -27,16 +27,16 @@ def test_long_reflog(self): with self.assertRaises(GitRepositoryError): self.repo.commit_dir(self.content, 'foo' * 100000, - 'master', + 'debian/latest', create_missing_branch=True) def test_long_msg_854333(self): """Make sure we shorten the reflog entry properly""" self.repo.commit_dir(self.content, 'foo\n' * 100000, - 'master', + 'debian/latest', create_missing_branch=True) - self.assertEquals(self.repo.show('master:file1'), b'content1') + self.assertEquals(self.repo.show('debian/latest:file1'), b'content1') out, dummy, ret = self.repo._git_inout('reflog', []) self.assertEquals(ret, 0) self.assertIn(b'HEAD@{0}: gbp: foo\n', out) diff --git a/tests/component/deb/fixtures.py b/tests/component/deb/fixtures.py index 78ba1e96..453b54b8 100644 --- a/tests/component/deb/fixtures.py +++ b/tests/component/deb/fixtures.py @@ -102,7 +102,7 @@ def _import_one(cls, dsc, opts): def import_native(cls, dsc=DEFAULT_NATIVE, opts=None): """Import a Debian native package, verify and change into repo""" repo = cls._import_one(dsc, opts) - ComponentTestBase._check_repo_state(repo, 'master', ['master']) + ComponentTestBase._check_repo_state(repo, 'debian/latest', ['debian/latest']) eq_(len(repo.get_commits()), 1) os.chdir(repo.path) return repo @@ -111,10 +111,10 @@ def import_native(cls, dsc=DEFAULT_NATIVE, opts=None): def import_quilt30(cls, dsc=DEFAULT_QUILT30, opts=None): """Import a 3.0 (quilt) package, verify and change into repo""" repo = cls._import_one(dsc, opts) - expected_branches = ['master', 'upstream'] + expected_branches = ['debian/latest', 'upstream'] if opts and '--pristine-tar' in opts: expected_branches.append('pristine-tar') - ComponentTestBase._check_repo_state(repo, 'master', expected_branches) + ComponentTestBase._check_repo_state(repo, 'debian/latest', expected_branches) eq_(len(repo.get_commits()), 2) os.chdir(repo.path) return repo @@ -123,10 +123,10 @@ def import_quilt30(cls, dsc=DEFAULT_QUILT30, opts=None): def import_quilt30_additional_tarball(cls, dsc=DEFAULT_ADDITIONAL_TAR, opts=None): """Import a 3.0 (quilt) package with additional tarball, verify and change into repo""" repo = cls._import_one(dsc, opts) - expected_branches = ['master', 'upstream'] + expected_branches = ['debian/latest', 'upstream'] if opts and '--pristine-tar' in opts: expected_branches.append('pristine-tar') - ComponentTestBase._check_repo_state(repo, 'master', expected_branches) + ComponentTestBase._check_repo_state(repo, 'debian/latest', expected_branches) eq_(len(repo.get_commits()), 2) os.chdir(repo.path) ok_(os.path.exists('./foo')) @@ -139,8 +139,8 @@ def import_debian_tarball(cls, debian=DEFAULT_OVERLAY, opts=None): UnpackTarArchive(debian, repo.path)() repo.add_files('.') repo.commit_files('.', msg="debian dir") - expected_branches = ['master'] - ComponentTestBase._check_repo_state(repo, 'master', expected_branches) + expected_branches = ['debian/latest'] + ComponentTestBase._check_repo_state(repo, 'debian/latest', expected_branches) eq_(len(repo.get_commits()), 1) os.chdir(repo.path) return repo diff --git a/tests/component/deb/test_buildpackage.py b/tests/component/deb/test_buildpackage.py index fe0802a0..02d9b152 100644 --- a/tests/component/deb/test_buildpackage.py +++ b/tests/component/deb/test_buildpackage.py @@ -93,7 +93,7 @@ def test_tag_only(self, repo): eq_(os.path.exists('../posttag.out'), True) eq_(os.path.exists('../builder-run.stamp'), False) self.check_hook_vars('../posttag', [("GBP_TAG", "debian/0.4.14"), - ("GBP_BRANCH", "master"), + ("GBP_BRANCH", "debian/latest"), "GBP_SHA1"]) def test_component_generation(self): @@ -262,24 +262,24 @@ def test_tarball_max_compression(self, repo): @RepoFixtures.quilt30() def test_tag_pq_branch(self, repo): ret = pq(['argv0', 'import']) - eq_(repo.rev_parse('master'), repo.rev_parse('debian/2.8-1^{}')) + eq_(repo.rev_parse('debian/latest'), repo.rev_parse('debian/2.8-1^{}')) eq_(ret, 0) - eq_(repo.branch, 'patch-queue/master') + eq_(repo.branch, 'patch-queue/debian/latest') self.add_file(repo, 'foo.txt') ret = buildpackage(['argv0', '--git-tag-only', '--git-retag', '--git-ignore-branch']) eq_(ret, 0) - eq_(repo.branch, 'patch-queue/master') - eq_(repo.rev_parse('patch-queue/master^{}^'), repo.rev_parse('debian/2.8-1^{}')) + eq_(repo.branch, 'patch-queue/debian/latest') + eq_(repo.rev_parse('patch-queue/debian/latest^{}^'), repo.rev_parse('debian/2.8-1^{}')) @RepoFixtures.quilt30() def test_tag_detached_head(self, repo): """ Test that tagging works with an detached head (#863167) """ - eq_(repo.rev_parse('master^{}'), repo.rev_parse('debian/2.8-1^{}')) + eq_(repo.rev_parse('debian/latest^{}'), repo.rev_parse('debian/2.8-1^{}')) self.add_file(repo, 'debian/foo.txt') repo.checkout("HEAD~") ret = buildpackage(['argv0', @@ -287,8 +287,8 @@ def test_tag_detached_head(self, repo): '--git-retag', '--git-ignore-branch']) eq_(ret, 0) - repo.checkout("master") - eq_(repo.rev_parse('master~^{}'), repo.rev_parse('debian/2.8-1^{}')) + repo.checkout("debian/latest") + eq_(repo.rev_parse('debian/latest~^{}'), repo.rev_parse('debian/2.8-1^{}')) @skip_without_cmd('debchange') @RepoFixtures.quilt30() diff --git a/tests/component/deb/test_clone.py b/tests/component/deb/test_clone.py index ada301cb..a60e2388 100644 --- a/tests/component/deb/test_clone.py +++ b/tests/component/deb/test_clone.py @@ -52,7 +52,7 @@ def test_clone_native(self, repo): '--postclone=printenv > ../postclone.out', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) assert len(cloned.get_commits()) == 1 self.check_hook_vars('../postclone', ["GBP_GIT_DIR"]) @@ -66,7 +66,7 @@ def test_clone_vcsgit_ok(self): cloned = ComponentTestGitRepository(dest) self._check_repo_state(cloned, 'debian/sid', ['debian/sid', 'upstream/latest']) assert cloned.has_remote_repo("upstreamvcs") - assert 'upstreamvcs/master' in cloned.get_remote_branches() + assert 'upstreamvcs/debian/latest' in cloned.get_remote_branches() @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled") def test_clone_vcsgit_fail(self): @@ -83,7 +83,7 @@ def test_clone_github(self): ret = clone(['arg0', "github:agx/git-buildpackage", dest]) self.assertEquals(ret, 0) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) @RepoFixtures.native() def test_clone_without_attrs(self, repo): @@ -93,7 +93,7 @@ def test_clone_without_attrs(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) attrs_file = os.path.join(dest, '.git', 'info', 'attributes') # file may be empty or absent @@ -113,7 +113,7 @@ def test_clone_with_attrs(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) attrs_file = os.path.join(dest, '.git', 'info', 'attributes') ok_(os.path.exists(attrs_file), "%s is missing" % attrs_file) diff --git a/tests/component/deb/test_dch.py b/tests/component/deb/test_dch.py index 1a1fc2dd..e96ac330 100644 --- a/tests/component/deb/test_dch.py +++ b/tests/component/deb/test_dch.py @@ -40,7 +40,7 @@ def _dsc_file(pkg, version, dir='dsc-3.0'): class TestDch(ComponentTestBase): """Test importing of new upstream versions""" pkg = "hello-debhelper" - def_branches = ['master', 'upstream', 'pristine-tar'] + def_branches = ['debian/latest', 'upstream', 'pristine-tar'] @RepoFixtures.quilt30(DEFAULT_DSC) def test_user_customizations(self, repo): diff --git a/tests/component/deb/test_import_dsc.py b/tests/component/deb/test_import_dsc.py index 3cdd2834..7d9c0d5d 100644 --- a/tests/component/deb/test_import_dsc.py +++ b/tests/component/deb/test_import_dsc.py @@ -67,7 +67,7 @@ def _dsc(version): dsc = _dsc('0.4.14') assert import_dsc(['arg0', dsc]) == 0 repo = ComponentTestGitRepository('git-buildpackage') - self._check_repo_state(repo, 'master', ['master']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest']) assert len(repo.get_commits()) == 1 commitmsg = repo.get_commit_info('HEAD')['body'] ok_("git-buildpackage (0.01) unstable; urgency=low" in commitmsg) @@ -76,7 +76,7 @@ def _dsc(version): os.chdir('git-buildpackage') dsc = _dsc('0.4.15') assert import_dsc(['arg0', dsc]) == 0 - self._check_repo_state(repo, 'master', ['master']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest']) assert len(repo.get_commits()) == 2 commitmsg = repo.get_commit_info('HEAD')['body'] ok_("git-buildpackage (0.4.14) unstable; urgency=low" not in commitmsg) @@ -84,7 +84,7 @@ def _dsc(version): dsc = _dsc('0.4.16') assert import_dsc(['arg0', dsc]) == 0 - self._check_repo_state(repo, 'master', ['master']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest']) assert len(repo.get_commits()) == 3 commitmsg = repo.get_commit_info('HEAD')['body'] ok_("git-buildpackage (0.4.14) unstable; urgency=low" not in commitmsg) @@ -102,7 +102,7 @@ def _dsc(version): '--allow-unauthenticated', dsc]) == 0 repo = ComponentTestGitRepository('git-buildpackage') - self._check_repo_state(repo, 'master', ['master']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest']) assert len(repo.get_commits()) == 1 @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled") @@ -124,14 +124,14 @@ def test_create_branches(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dsc]) == 0 repo = ComponentTestGitRepository('hello-debhelper') os.chdir('hello-debhelper') assert len(repo.get_commits()) == 2 self._check_reflog(repo) - self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'pristine-tar', 'upstream']) dsc = self._dsc30('2.8-1') assert import_dsc(['arg0', '--verbose', @@ -140,7 +140,7 @@ def test_create_branches(self): '--upstream-branch=bar', '--create-missing-branches', dsc]) == 0 - self._check_repo_state(repo, 'master', ['bar', 'foo', 'master', 'pristine-tar', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['bar', 'foo', 'debian/latest', 'pristine-tar', 'upstream']) commits, expected = len(repo.get_commits()), 2 ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected)) @@ -149,11 +149,11 @@ def test_import_30_pristine_tar(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dscfile]) == 0 repo = ComponentTestGitRepository('hello-debhelper') - self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'pristine-tar', 'upstream']) commits, expected = len(repo.get_commits()), 2 commitmsg = repo.get_commit_info('HEAD')['body'] eq_("hello-debhelper (2.6-1) unstable; urgency=low", commitmsg.split('\n')[0]) @@ -164,7 +164,7 @@ def test_import_30_pristine_tar(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dscfile]) == 0 commits, expected = len(repo.get_commits()), 3 @@ -186,11 +186,11 @@ def _dsc(version): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dscfile]) == 0 repo = ComponentTestGitRepository('hello-debhelper') - self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'pristine-tar', 'upstream']) commits, expected = len(repo.get_commits()), 2 commitmsg = repo.get_commit_info('HEAD')['body'] ok_("hello-debhelper (2.8-1) unstable; urgency=low" in commitmsg) @@ -229,7 +229,7 @@ def test_existing_dir(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dsc]) == 1 self._check_log(0, "gbp:error: Directory 'hello-debhelper' already exists. If you want to import into it, " @@ -245,7 +245,7 @@ def _dsc(version): dsc = _dsc('2.6-2') assert import_dsc(['arg0', dsc]) == 0 repo = ComponentTestGitRepository('hello-debhelper') - self._check_repo_state(repo, 'master', ['master', 'upstream'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], tags=['upstream/2.6', 'debian/2.6-2']) assert len(repo.get_commits()) == 2 @@ -259,7 +259,7 @@ def test_target_dir(self): 'targetdir']) == 0 assert os.path.exists('targetdir') repo = ComponentTestGitRepository('targetdir') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) def test_bare(self): """Test that importing into bare repository works""" @@ -267,14 +267,14 @@ def test_bare(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dsc]) == 0 repo = ComponentTestGitRepository('hello-debhelper') os.chdir('hello-debhelper') assert len(repo.get_commits()) == 2 self._check_reflog(repo) - self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'pristine-tar', 'upstream']) commitmsg = repo.get_commit_info('HEAD')['body'] ok_("hello-debhelper (2.6-2) unstable; urgency=medium" in commitmsg) ok_("hello (1.3-7) experimental; urgency=LOW" in commitmsg) @@ -283,7 +283,7 @@ def test_bare(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dsc]) == 0 commits, expected = len(repo.get_commits()), 4 @@ -337,16 +337,16 @@ def test_empty_repo(self): ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected)) def test_upstream_branch_is_master(self): - """Make sure we can import when upstream-branch == master (#750962)""" + """Make sure we can import when upstream-branch == debian/latest (#750962)""" dsc = self._dsc30('2.6-2') assert import_dsc(['arg0', '--verbose', '--no-pristine-tar', '--debian-branch=debian', - '--upstream-branch=master', + '--upstream-branch=debian/latest', dsc]) == 0 repo = ComponentTestGitRepository('hello-debhelper') - self._check_repo_state(repo, 'debian', ['debian', 'master']) + self._check_repo_state(repo, 'debian', ['debian', 'debian/latest']) commits, expected = len(repo.get_commits()), 2 ok_(commits == expected, "Found %d commit instead of %d" % (commits, expected)) @@ -355,13 +355,13 @@ def test_import_30_filters(self): assert import_dsc(['arg0', '--verbose', '--no-pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', '--filter=debian/patches/*', '--filter=AUTHORS', dscfile]) == 0 repo = ComponentTestGitRepository('hello-debhelper') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) os.chdir('hello-debhelper') ok_(os.path.exists("./debian/changelog")) ok_(os.path.exists("./configure.ac")) @@ -373,11 +373,11 @@ def test_import_signature(self): assert import_dsc(['arg0', '--verbose', '--pristine-tar', - '--debian-branch=master', + '--debian-branch=debian/latest', '--upstream-branch=upstream', dscfile]) == 0 repo = ComponentTestGitRepository('hello-debhelper') - self._check_repo_state(repo, 'master', ['master', 'pristine-tar', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'pristine-tar', 'upstream']) commits, expected = len(repo.get_commits()), 2 commits, expected = len(repo.get_commits(until='pristine-tar')), 1 ok_(commits == expected, "Found %d pristine-tar commits instead of %d" % (commits, expected)) diff --git a/tests/component/deb/test_import_dscs.py b/tests/component/deb/test_import_dscs.py index 480d3de1..9d1ef9ef 100644 --- a/tests/component/deb/test_import_dscs.py +++ b/tests/component/deb/test_import_dscs.py @@ -40,7 +40,7 @@ def _dsc(version): dsc2 = _dsc('0.4.15') assert import_dscs(['arg0', dsc1, dsc2]) == 0 repo = ComponentTestGitRepository('git-buildpackage') - self._check_repo_state(repo, 'master', ['master']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest']) assert len(repo.get_commits()) == 2 commitmsg = repo.get_commit_info('HEAD')['body'] ok_("git-buildpackage (0.4.15) unstable; urgency=low" in commitmsg) diff --git a/tests/component/deb/test_import_orig.py b/tests/component/deb/test_import_orig.py index 2a949fbd..3666c840 100644 --- a/tests/component/deb/test_import_orig.py +++ b/tests/component/deb/test_import_orig.py @@ -54,7 +54,7 @@ def _dsc_file(pkg, version, dir='dsc-3.0'): class TestImportOrig(ComponentTestBase): """Test importing of new upstream versions""" pkg = "hello-debhelper" - def_branches = ['master', 'upstream', 'pristine-tar'] + def_branches = ['debian/latest', 'upstream', 'pristine-tar'] def _orig(self, version, dir='dsc-3.0'): return os.path.join(DEB_TEST_DATA_DIR, @@ -72,7 +72,7 @@ def test_initial_import(self): os.chdir(self.pkg) orig = self._orig('2.6') ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0) - self._check_repo_state(repo, 'master', self.def_branches, + self._check_repo_state(repo, 'debian/latest', self.def_branches, tags=['upstream/2.6']) @skipUnless(os.getenv("GBP_NETWORK_TESTS"), "network tests disabled") @@ -82,7 +82,7 @@ def test_download(self): os.chdir(self.pkg) orig = self._download_url('2.6') ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0) - self._check_repo_state(repo, 'master', self.def_branches, + self._check_repo_state(repo, 'debian/latest', self.def_branches, tags=['upstream/2.6']) def _check_component_tarballs(self, repo, files): @@ -102,11 +102,11 @@ def test_update(self, repo): '--postimport=printenv > ../postimport.out', '--postunpack=printenv > ../postunpack.out', '--no-interactive', '--pristine-tar', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) ok_(os.path.exists('debian/changelog')) ok_(os.path.exists('../postimport.out')) - self.check_hook_vars('../postimport', [("GBP_BRANCH", "master"), + self.check_hook_vars('../postimport', [("GBP_BRANCH", "debian/latest"), ("GBP_TAG", "upstream/2.8"), ("GBP_UPSTREAM_VERSION", "2.8"), ("GBP_DEBIAN_VERSION", "2.8-1")]) @@ -119,7 +119,7 @@ def test_update_component_tarballs(self, repo): # Import 2.8 orig = self._orig('2.8', dir='dsc-3.0-additional-tarballs') ok_(import_orig(['arg0', '--component=foo', '--no-interactive', '--pristine-tar', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) self._check_component_tarballs(repo, [b'foo/test1', b'foo/test2']) ok_(os.path.exists('debian/changelog')) @@ -144,7 +144,7 @@ def test_update_component_tarballs(self, repo): # Import 2.9 orig = self._orig('2.9', dir='dsc-3.0-additional-tarballs') ok_(import_orig(['arg0', '--component=foo', '--no-interactive', '--pristine-tar', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8', 'upstream/2.9']) self._check_component_tarballs(repo, ['foo/test1', 'foo/test2', 'foo/test3']) ok_(os.path.exists('debian/changelog')) @@ -169,7 +169,7 @@ def test_update_from_upstream_branch(self, repo): orig = self._orig('2.8') repo.checkout('upstream') ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 0) - self._check_repo_state(repo, 'upstream', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'upstream', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) def test_tag_exists(self): @@ -197,7 +197,7 @@ def test_update_fail_create_upstream_tag(self, repo): with patch('gbp.git.repository.GitRepository.create_tag', side_effect=GitRepositoryError('this is a create tag error mock')): ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 1) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6']) self.check_refs(repo, heads) @@ -211,7 +211,7 @@ def test_update_fail_merge(self, repo): with patch('gbp.scripts.import_orig.debian_branch_merge', side_effect=GitRepositoryError('this is a fail merge error mock')): ok_(import_orig(['arg0', '--no-interactive', '--pristine-tar', orig]) == 1) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6']) self.check_refs(repo, heads) @@ -262,7 +262,7 @@ def test_filter_with_component_tarballs(self, repo): '--filter-pristine-tar', '--filter=README*', '../tarballs/hello-debhelper_2.8.orig.tar.gz']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) self._check_component_tarballs(repo, ['foo/test1', 'foo/test2']) @@ -304,7 +304,7 @@ def test_filter_with_component_tarballs_and_postunpack_changes(self, repo): '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' + 'rm $GBP_SOURCES_DIR/TODO', '../tarballs/hello-debhelper_2.8.orig.tar.gz']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) self._check_component_tarballs(repo, ['foo/test1', 'foo/test2']) @@ -342,7 +342,7 @@ def test_filter_with_orig_tarball(self, repo): '--filter-pristine-tar', '--filter=README*', '../hello-debhelper_2.8.orig.tar.gz']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) filtered = os.path.join('..', f) @@ -378,7 +378,7 @@ def test_filter_with_orig_tarball_and_postunpack_changes(self, repo): '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' + 'rm $GBP_SOURCES_DIR/TODO', '../hello-debhelper_2.8.orig.tar.gz']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) filtered = os.path.join('..', f) @@ -412,7 +412,7 @@ def test_postunpack_changes_with_orig_tarball(self, repo): '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' + 'rm $GBP_SOURCES_DIR/TODO; rm $GBP_SOURCES_DIR/README', '../hello-debhelper_2.8.orig.tar.gz']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) filtered = os.path.join('..', f) @@ -447,7 +447,7 @@ def test_filter_unpacked_dir(self, repo): '--filter-pristine-tar', '--filter=README*', '../hello-2.8']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) filtered = os.path.join('..', f) @@ -484,7 +484,7 @@ def test_filter_unpacked_dir_with_postunpack_changes(self, repo): '--postunpack=printenv > $GBP_SOURCES_DIR/postunpack.out;' + 'rm $GBP_SOURCES_DIR/TODO', '../hello-2.8']) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) filtered = os.path.join('..', f) @@ -529,13 +529,13 @@ def test_with_signaturefile(self): '--postunpack=printenv > ../postunpack.out', '--no-interactive', '--pristine-tar', '--upstream-signatures=on', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['upstream/2.8']) ok_(os.path.exists('../postimport.out')) eq_(repo.ls_tree('pristine-tar'), {b'hello-debhelper_2.8.orig.tar.gz.id', b'hello-debhelper_2.8.orig.tar.gz.delta', b'hello-debhelper_2.8.orig.tar.gz.asc'}) - self.check_hook_vars('../postimport', [("GBP_BRANCH", "master"), + self.check_hook_vars('../postimport', [("GBP_BRANCH", "debian/latest"), ("GBP_TAG", "upstream/2.8"), ("GBP_UPSTREAM_VERSION", "2.8"), ("GBP_DEBIAN_VERSION", "2.8-1")]) @@ -553,13 +553,13 @@ def test_with_auto_signaturefile(self): '--postunpack=printenv > ../postunpack.out', '--no-interactive', '--pristine-tar', '--upstream-signatures=auto', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar'], tags=['upstream/2.8']) ok_(os.path.exists('../postimport.out')) eq_(repo.ls_tree('pristine-tar'), {b'hello-debhelper_2.8.orig.tar.gz.id', b'hello-debhelper_2.8.orig.tar.gz.delta', b'hello-debhelper_2.8.orig.tar.gz.asc'}) - self.check_hook_vars('../postimport', [("GBP_BRANCH", "master"), + self.check_hook_vars('../postimport', [("GBP_BRANCH", "debian/latest"), ("GBP_TAG", "upstream/2.8"), ("GBP_UPSTREAM_VERSION", "2.8"), ("GBP_DEBIAN_VERSION", "2.8-1")]) @@ -591,5 +591,5 @@ def test_uscan(self, repo): repo.add_files(["debian/watch"]) repo.commit_files("debian/watch", msg="Add watch file") ok_(import_orig(['arg0', '--uscan', '--no-interactive', '--no-pristine-tar']) == 0) - self._check_repo_state(repo, 'master', self.def_branches, + self._check_repo_state(repo, 'debian/latest', self.def_branches, tags=['debian/2.6-2', 'upstream/2.6', 'upstream/2.8']) diff --git a/tests/component/deb/test_import_ref.py b/tests/component/deb/test_import_ref.py index 260a8be1..d62add9f 100644 --- a/tests/component/deb/test_import_ref.py +++ b/tests/component/deb/test_import_ref.py @@ -37,7 +37,7 @@ def _dsc_file(pkg, version, dir='dsc-3.0'): class TestImportRef(ComponentTestBase): """Test importing of new upstream versions""" pkg = "hello-debhelper" - def_branches = ['master', 'upstream', 'pristine-tar'] + def_branches = ['debian/latest', 'upstream', 'pristine-tar'] def _orig(self, version, dir='dsc-3.0'): return os.path.join(DEB_TEST_DATA_DIR, @@ -54,7 +54,7 @@ def test_from_branch(self, repo): '--upstream-tree=BRANCH', '--upstream-tag=theupstream/%(version)s', '-uaversion']) == 0) - self._check_repo_state(repo, 'master', self.def_branches, + self._check_repo_state(repo, 'debian/latest', self.def_branches, tags=['debian/2.6-2', 'theupstream/aversion', 'upstream/2.6']) eq_(len(repo.get_commits()), 3) @@ -68,7 +68,7 @@ def test_from_version(self, repo): '--upstream-tree=VERSION', '--upstream-tag=upstream/%(version)s', '-u2.6']) == 0) - self._check_repo_state(repo, 'master', self.def_branches, + self._check_repo_state(repo, 'debian/latest', self.def_branches, tags=['debian/2.6-2', 'upstream/2.6']) eq_(len(repo.get_commits()), 3) @@ -82,6 +82,6 @@ def test_from_committish(self, repo): '--upstream-tree=upstream', '--upstream-tag=upstream/%(version)s', '-u2.6']) == 0) - self._check_repo_state(repo, 'master', self.def_branches, + self._check_repo_state(repo, 'debian/latest', self.def_branches, tags=['debian/2.6-2', 'upstream/2.6']) eq_(len(repo.get_commits()), 3) diff --git a/tests/component/deb/test_pq.py b/tests/component/deb/test_pq.py index 3c888278..108351b0 100644 --- a/tests/component/deb/test_pq.py +++ b/tests/component/deb/test_pq.py @@ -41,33 +41,33 @@ def _test_pq(self, repo, action, opts=[]): @RepoFixtures.quilt30() def test_rebase_import(self, repo): """Test that rebase imports patches first""" - eq_(repo.branch, 'master') - eq_(repo.has_branch('patch-queue/master'), False) + eq_(repo.branch, 'debian/latest') + eq_(repo.has_branch('patch-queue/debian/latest'), False) self._test_pq(repo, 'rebase') - eq_(repo.has_branch('patch-queue/master'), True) + eq_(repo.has_branch('patch-queue/debian/latest'), True) @RepoFixtures.quilt30() def test_switch_import(self, repo): """Test that switch imports patches first""" - eq_(repo.branch, 'master') - eq_(repo.has_branch('patch-queue/master'), False) + eq_(repo.branch, 'debian/latest') + eq_(repo.has_branch('patch-queue/debian/latest'), False) self._test_pq(repo, 'switch') - eq_(repo.has_branch('patch-queue/master'), True) + eq_(repo.has_branch('patch-queue/debian/latest'), True) @RepoFixtures.quilt30() def test_empty_cycle(self, repo): - eq_(repo.has_branch('patch-queue/master'), False) - eq_(repo.branch, 'master') + eq_(repo.has_branch('patch-queue/debian/latest'), False) + eq_(repo.branch, 'debian/latest') self._test_pq(repo, 'import') - eq_(repo.has_branch('patch-queue/master'), True) - eq_(repo.branch, 'patch-queue/master') + eq_(repo.has_branch('patch-queue/debian/latest'), True) + eq_(repo.branch, 'patch-queue/debian/latest') self._test_pq(repo, 'rebase') - eq_(repo.branch, 'patch-queue/master') + eq_(repo.branch, 'patch-queue/debian/latest') self._test_pq(repo, 'export') - eq_(repo.has_branch('patch-queue/master'), True) - eq_(repo.branch, 'master') + eq_(repo.has_branch('patch-queue/debian/latest'), True) + eq_(repo.branch, 'debian/latest') self._test_pq(repo, 'drop') - eq_(repo.has_branch('patch-queue/master'), False) + eq_(repo.has_branch('patch-queue/debian/latest'), False) @RepoFixtures.quilt30() def test_rename(self, repo): diff --git a/tests/component/deb/test_pristine_tar.py b/tests/component/deb/test_pristine_tar.py index d6ecb6e4..d87a1ae3 100644 --- a/tests/component/deb/test_pristine_tar.py +++ b/tests/component/deb/test_pristine_tar.py @@ -37,7 +37,7 @@ def _dsc_file(pkg, version, dir='dsc-3.0'): class TestPristineTar(ComponentTestBase): """Test pristine-tar commit tool""" pkg = "hello-debhelper" - def_branches = ['master', 'upstream', 'pristine-tar'] + def_branches = ['debian/latest', 'upstream', 'pristine-tar'] def _orig(self, version, dir='dsc-3.0'): return os.path.join(DEB_TEST_DATA_DIR, @@ -51,7 +51,7 @@ def test_run(self, repo): """ orig = self._orig('2.6') ok_(pristine_tar(['arg0', 'commit', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar']) @RepoFixtures.quilt30(_dsc_file('hello-debhelper', '2.8-1', @@ -63,7 +63,7 @@ def test_run_component_tarball(self, repo): """ orig = self._orig('2.8', dir='dsc-3.0-additional-tarballs') ok_(pristine_tar(['arg0', 'commit', '--component=foo', orig]) == 0) - self._check_repo_state(repo, 'master', ['master', 'upstream', 'pristine-tar']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar']) ptars = [('hello-debhelper_2.8.orig.tar.gz', 'pristine-tar'), ('hello-debhelper_2.8.orig-foo.tar.gz', 'pristine-tar^')] diff --git a/tests/component/deb/test_pull.py b/tests/component/deb/test_pull.py index 3b34ce49..d90e29b9 100644 --- a/tests/component/deb/test_pull.py +++ b/tests/component/deb/test_pull.py @@ -37,7 +37,7 @@ def test_pull_explicit_remote(self, repo): dest = os.path.join(self._tmpdir, 'cloned_repo') clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) eq_(pull(['argv0', 'origin']), 0) assert len(repo.get_commits()) == 1 @@ -47,7 +47,7 @@ def test_pull_default_remote(self, repo): dest = os.path.join(self._tmpdir, 'cloned_repo') clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) eq_(pull(['argv0']), 0) assert len(repo.get_commits()) == 1 @@ -65,12 +65,12 @@ def test_pull_all(self, repo): os.mkdir(tmp_workdir) with open(os.path.join(tmp_workdir, 'new_file'), 'w'): pass - repo.commit_dir(tmp_workdir, 'New commit in master', branch='master') + repo.commit_dir(tmp_workdir, 'New commit in debian/latest', branch='debian/latest') repo.commit_dir(tmp_workdir, 'New commit in foob', branch='foob') # Check that the branch is not updated when --all is not used eq_(pull(['argv0']), 0) - eq_(len(cloned.get_commits(until='master')), 3) + eq_(len(cloned.get_commits(until='debian/latest')), 3) eq_(len(cloned.get_commits(until='upstream')), 1) eq_(len(cloned.get_commits(until='foob')), 2) @@ -87,20 +87,20 @@ def test_tracking(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) os.chdir(cloned.path) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) # Pull initially eq_(pull(['argv0']), 0) assert len(repo.get_commits()) == 1 - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) # Pick up missing branches (none exist yet) eq_(pull(['argv0', '--track-missing']), 0) assert len(repo.get_commits()) == 1 - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) # Pick up missing branches repo.create_branch('pristine-tar') repo.create_branch('upstream') eq_(pull(['argv0', '--track-missing', '--pristine-tar']), 0) assert len(repo.get_commits()) == 1 - self._check_repo_state(cloned, 'master', ['master', 'pristine-tar', 'upstream']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest', 'pristine-tar', 'upstream']) diff --git a/tests/component/deb/test_push.py b/tests/component/deb/test_push.py index 50733280..1685e16b 100644 --- a/tests/component/deb/test_push.py +++ b/tests/component/deb/test_push.py @@ -38,8 +38,8 @@ def setUp(self): def test_push_native(self, repo): repo.add_remote_repo('origin', self.target.path) self.assertEquals(push(['argv0']), 0) - self._check_repo_state(self.target, 'master', - ['master'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest'], tags=['debian/0.4.14']) self.assertEquals(repo.head, self.target.head) @@ -47,8 +47,8 @@ def test_push_native(self, repo): def test_push_upstream(self, repo): repo.add_remote_repo('origin', self.target.path) self.assertEquals(push(['argv0']), 0) - self._check_repo_state(self.target, 'master', - ['master', 'upstream'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest', 'upstream'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) @@ -56,8 +56,8 @@ def test_push_upstream(self, repo): def test_push_pristine_tar(self, repo): repo.add_remote_repo('origin', self.target.path) self.assertEquals(push(['argv0', '--pristine-tar']), 0) - self._check_repo_state(self.target, 'master', - ['master', 'upstream', 'pristine-tar'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest', 'upstream', 'pristine-tar'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) @@ -76,8 +76,8 @@ def test_push_detached_head(self, repo): def test_push_skip_upstream(self, repo): repo.add_remote_repo('origin', self.target.path) self.assertEquals(push(['argv0', '--upstream-branch=']), 0) - self._check_repo_state(self.target, 'master', - ['master'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) @@ -86,8 +86,8 @@ def test_push_tag_ne_branch(self, repo): repo.add_remote_repo('origin', self.target.path) self.add_file(repo, "foo.txt", "foo") self.assertEquals(push(['argv0']), 0) - self._check_repo_state(self.target, 'master', - ['master'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest'], tags=['debian/0.4.14']) self.assertEquals(repo.rev_parse("HEAD^"), self.target.head) @@ -98,7 +98,7 @@ def test_not_debian_branch(self, repo): repo.create_branch("foo") repo.set_branch("foo") self.assertEquals(push(['argv0']), 1) - self._check_log(-2, ".*You are not on branch 'master' but on 'foo'") + self._check_log(-2, ".*You are not on branch 'debian/latest' but on 'foo'") @skip_without_cmd('debchange') @RepoFixtures.quilt30() @@ -114,19 +114,19 @@ def test_dont_push_unreleased(self, repo): def test_push_not_origin(self, repo): repo.add_remote_repo('notorigin', self.target.path) self.assertEquals(push(['argv0', 'notorigin']), 0) - self._check_repo_state(self.target, 'master', - ['master', 'upstream'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest', 'upstream'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) @RepoFixtures.quilt30() def test_push_not_origin_detect(self, repo): repo.add_remote_repo('notorigin', self.target.path) - repo.set_config("branch.master.remote", "notorigin") - repo.set_config("branch.master.merge", "refs/heads/master") + repo.set_config("branch.debian/latest.remote", "notorigin") + repo.set_config("branch.debian/latest.merge", "refs/heads/debian/latest") self.assertEquals(push(['argv0']), 0) - self._check_repo_state(self.target, 'master', - ['master', 'upstream'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest', 'upstream'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) @@ -138,12 +138,12 @@ def test_push_failure(self, repo): repo.add_remote_repo('origin', self.target.path) # Make the upstream branch not fast forwardable so pushing to it fails - repo.push('origin', 'master') - self.target.create_branch('upstream', 'master') + repo.push('origin', 'debian/latest') + self.target.create_branch('upstream', 'debian/latest') self.assertEquals(push(['argv0']), 1) - self._check_repo_state(self.target, 'master', - ['master', 'upstream'], + self._check_repo_state(self.target, 'debian/latest', + ['debian/latest', 'upstream'], tags=['debian/2.8-1', 'upstream/2.8']) self.assertEquals(repo.head, self.target.head) self._check_in_log('.*Error running git push: To.*/target') diff --git a/tests/component/deb/test_setup_gitattributes.py b/tests/component/deb/test_setup_gitattributes.py index c779a425..a87108fc 100644 --- a/tests/component/deb/test_setup_gitattributes.py +++ b/tests/component/deb/test_setup_gitattributes.py @@ -63,7 +63,7 @@ def test_setup_gitattrs_do_nothing(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) attrs_file = os.path.join(dest, '.git', 'info', 'attributes') @@ -89,7 +89,7 @@ def test_setup_gitattrs(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) attrs_file = os.path.join(dest, '.git', 'info', 'attributes') @@ -114,7 +114,7 @@ def test_setup_gitattrs_dgit(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) attrs_file = os.path.join(dest, '.git', 'info', 'attributes') @@ -149,7 +149,7 @@ def test_setup_gitattrs_dgit34(self, repo): clone(['arg0', repo.path, dest]) cloned = ComponentTestGitRepository(dest) - self._check_repo_state(cloned, 'master', ['master']) + self._check_repo_state(cloned, 'debian/latest', ['debian/latest']) attrs_file = os.path.join(dest, '.git', 'info', 'attributes') diff --git a/tests/component/deb/test_tag.py b/tests/component/deb/test_tag.py index f56dabb3..a1bf8195 100644 --- a/tests/component/deb/test_tag.py +++ b/tests/component/deb/test_tag.py @@ -47,31 +47,31 @@ def test_tag(self, repo): ok_(ret == 0, "Tagging the package failed") eq_(os.path.exists('posttag.out'), True) self.check_hook_vars('posttag', [("GBP_TAG", "debian/0.4.14"), - ("GBP_BRANCH", "master"), + ("GBP_BRANCH", "debian/latest"), "GBP_SHA1"]) eq_(repo.head, repo.rev_parse('debian/0.4.14^{}')) @RepoFixtures.quilt30() def test_tag_pq_branch(self, repo): ret = pq(['argv0', 'import']) - eq_(repo.rev_parse('master'), repo.rev_parse('debian/2.8-1^{}')) + eq_(repo.rev_parse('debian/latest'), repo.rev_parse('debian/2.8-1^{}')) eq_(ret, 0) - eq_(repo.branch, 'patch-queue/master') + eq_(repo.branch, 'patch-queue/debian/latest') self.add_file(repo, 'foo.txt') ret = tag(['argv0', '--retag', '--ignore-branch']) eq_(ret, 0) - eq_(repo.branch, 'patch-queue/master') - eq_(repo.rev_parse('patch-queue/master^{}^'), repo.rev_parse('debian/2.8-1^{}')) + eq_(repo.branch, 'patch-queue/debian/latest') + eq_(repo.rev_parse('patch-queue/debian/latest^{}^'), repo.rev_parse('debian/2.8-1^{}')) @RepoFixtures.quilt30() def test_tag_detached_head(self, repo): """ Test that tagging works with an detached head (#863167) """ - eq_(repo.rev_parse('master^{}'), repo.rev_parse('debian/2.8-1^{}')) + eq_(repo.rev_parse('debian/latest^{}'), repo.rev_parse('debian/2.8-1^{}')) self.add_file(repo, 'debian/foo.txt') repo.checkout("HEAD~") ret = tag(['argv0', '--retag', '--ignore-branch']) eq_(ret, 0) - repo.checkout("master") - eq_(repo.rev_parse('master~^{}'), repo.rev_parse('debian/2.8-1^{}')) + repo.checkout("debian/latest") + eq_(repo.rev_parse('debian/latest~^{}'), repo.rev_parse('debian/2.8-1^{}')) diff --git a/tests/component/rpm/test_import_orig_rpm.py b/tests/component/rpm/test_import_orig_rpm.py index 5ed41c61..d4f6ef7c 100644 --- a/tests/component/rpm/test_import_orig_rpm.py +++ b/tests/component/rpm/test_import_orig_rpm.py @@ -125,31 +125,31 @@ def test_import_tars(self): orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2') eq_(mock_import(['--merge', orig]), 0) files = ['Makefile', 'README', 'dummy.sh'] - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) - eq_(len(repo.get_commits(until='master')), 1) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) + eq_(len(repo.get_commits(until='debian/latest')), 1) eq_(len(repo.get_commits(until='upstream')), 1) eq_(repo.get_tags(), ['upstream/1.0']) - # Import second version, don't merge to master branch + # Import second version, don't merge to debian/latest branch orig = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2') eq_(mock_import(['--no-merge', orig]), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) - eq_(len(repo.get_commits(until='master')), 1) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) + eq_(len(repo.get_commits(until='debian/latest')), 1) eq_(len(repo.get_commits(until='upstream')), 2) eq_(repo.get_tags(), ['upstream/1.0', 'upstream/1.1']) - # Check that master is based on v1.0 + # Check that debian/latest is based on v1.0 sha1 = repo.rev_parse("%s^0" % 'upstream/1.0') - eq_(repo.get_merge_base('master', 'upstream'), sha1) + eq_(repo.get_merge_base('debian/latest', 'upstream'), sha1) def test_import_zip(self): """Test importing of zip archive""" repo = ComponentTestGitRepository.create('.') - # Import zip with, no master branch should be present + # Import zip with, no debian/latest branch should be present orig = os.path.join(DATA_DIR, 'gbp-test-native-1.0.zip') files = ['.gbp.conf', 'packaging/gbp-test-native.spec', 'dummy.sh', 'README', 'Makefile'] eq_(mock_import([orig]), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) eq_(repo.get_tags(), ['upstream/1.0']) def test_branch_update(self): @@ -161,7 +161,7 @@ def test_branch_update(self): repo.set_branch('upstream') eq_(mock_import([orig2]), 0) files = ['Makefile', 'README', 'dummy.sh'] - self._check_repo_state(repo, 'upstream', ['master', 'upstream'], files) + self._check_repo_state(repo, 'upstream', ['debian/latest', 'upstream'], files) eq_(len(repo.get_commits(until='upstream')), 2) def test_import_dir(self): @@ -175,7 +175,7 @@ def test_import_dir(self): # Import dir first, fool the version to be 0.9 eq_(mock_import(['../gbp-test'], 'gbp-test\n0.9\n'), 0) files = ['Makefile', 'README', 'dummy.sh'] - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) # Import from unpacked and check that the contents is the same eq_(mock_import([orig]), 0) @@ -192,8 +192,8 @@ def test_basic_filtering(self): # Try filtering out .git directory and shell scripts eq_(mock_import(['--filter=.git', '--filter=*.sh', '--merge', orig], 'gbp-test\n1.0\n'), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream']) - eq_(len(repo.get_commits(until='master')), 1) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) + eq_(len(repo.get_commits(until='debian/latest')), 1) eq_(len(repo.get_commits(until='upstream')), 1) eq_(repo.get_tags(), ['upstream/1.0']) added_files = repo.get_commit_info('upstream')['files']['A'] @@ -216,8 +216,8 @@ def test_noninteractive(self): stdin_data=''), 0) files = ['.gbp.conf', 'Makefile', 'README', 'dummy.sh', 'packaging/gbp-test-native.spec'] - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) - eq_(len(repo.get_commits(until='master')), 1) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) + eq_(len(repo.get_commits(until='debian/latest')), 1) def test_misc_options(self): """Test various options of git-import-orig-rpm""" @@ -270,11 +270,11 @@ def test_import_hooks(self): script = ("echo -n branch: $GBP_BRANCH > ../hook.txt") eq_(mock_import(['--postimport', script, '--merge', orig]), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) eq_(repo.get_tags(), ['upstream/1.0']) with open('../hook.txt', 'r') as hookout: data = hookout.read() - eq_(data, 'branch: master') + eq_(data, 'branch: debian/latest') def test_hook_error(self): """Test postimport hook failure""" @@ -284,7 +284,7 @@ def test_hook_error(self): self._check_log(-2, "gbp:error: Postimport-hook '/bin/false' failed:") self._check_log(-1, 'gbp:error: Import of %s failed' % orig) # Other parts of the import should've succeeded - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) class TestBareRepo(ImportOrigTestBase): @@ -295,7 +295,7 @@ def test_basic_import_to_bare_repo(self): repo = ComponentTestGitRepository.create('.', bare=True) orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2') eq_(mock_import([orig]), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) eq_(len(repo.get_commits(until='upstream')), 1) eq_(repo.get_tags(), ['upstream/1.0']) @@ -303,7 +303,7 @@ def test_basic_import_to_bare_repo(self): repo.set_branch('upstream') orig = os.path.join(DATA_DIR, 'gbp-test-1.1.tar.bz2') eq_(mock_import([orig]), 0) - self._check_repo_state(repo, 'upstream', ['master', 'upstream']) + self._check_repo_state(repo, 'upstream', ['debian/latest', 'upstream']) eq_(len(repo.get_commits(until='upstream')), 2) def test_pristine_import_to_bare(self): @@ -312,4 +312,4 @@ def test_pristine_import_to_bare(self): orig = os.path.join(DATA_DIR, 'gbp-test-1.0.tar.bz2') eq_(mock_import([orig]), 0) # No pristine-tar branch should be present - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) diff --git a/tests/component/rpm/test_import_srpm.py b/tests/component/rpm/test_import_srpm.py index 17344b21..b0d137b0 100644 --- a/tests/component/rpm/test_import_srpm.py +++ b/tests/component/rpm/test_import_srpm.py @@ -59,7 +59,7 @@ def test_basic_import(self): repo = GitRepository('gbp-test') files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt', 'gbp-test.spec', 'my.patch', 'my2.patch', 'my3.patch'} - self._check_repo_state(repo, 'master', ['master', 'upstream'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files=files, tags=['packaging/1.0-1', 'upstream/1.0']) # Two commits: upstream and packaging files @@ -74,7 +74,7 @@ def test_basic_import2(self): files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt', 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch', 'my2.patch', 'my3.patch'} - self._check_repo_state(repo, 'master', ['master', 'upstream'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files=files, tags=['packaging/1%2.0-0', 'upstream/2.0']) # Two commits: upstream and packaging files @@ -87,7 +87,7 @@ def test_target_dir(self): # Check repository state assert os.path.exists('targetdir') repo = GitRepository('targetdir') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) def test_basic_import_orphan(self): """ @@ -100,7 +100,7 @@ def test_basic_import_orphan(self): repo = GitRepository('gbp-test2') files = {'bar.tar.gz', 'foo.txt', 'gbp-test2.spec', 'gbp-test2-alt.spec', 'my.patch', 'my2.patch', 'my3.patch'} - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) # Only one commit: the packaging files eq_(len(repo.get_commits()), 1) @@ -112,7 +112,7 @@ def test_basic_native_import(self): files = {'.gbp.conf', 'Makefile', 'README', 'dummy.sh', 'packaging/gbp-test-native.spec'} repo = GitRepository('gbp-test-native') - self._check_repo_state(repo, 'master', ['master'], + self._check_repo_state(repo, 'debian/latest', ['debian/latest'], files=files, tags=['packaging/1.0-1']) # Only one commit: the imported source tarball @@ -124,7 +124,7 @@ def test_import_no_orig_src(self): eq_(mock_import([srpm]), 0) # Check repository state repo = GitRepository('gbp-test-native2') - self._check_repo_state(repo, 'master', ['master']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest']) # Only one commit: packaging files eq_(len(repo.get_commits()), 1) @@ -135,7 +135,7 @@ def test_multiple_versions(self): 'gbp-test-1.1-1.src.rpm']] eq_(mock_import(['--no-pristine-tar', srpms[0]]), 0) repo = GitRepository('gbp-test') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) eq_(len(repo.get_commits()), 2) # Try to import same version again eq_(mock_import([srpms[1]]), 0) @@ -149,7 +149,7 @@ def test_multiple_versions(self): eq_(mock_import(['--no-pristine-tar', srpms[2]]), 0) files = {'Makefile', 'README', 'bar.tar.gz', 'dummy.sh', 'foo.txt', 'gbp-test.spec', 'my.patch', 'my2.patch', 'my3.patch'} - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) eq_(len(repo.get_commits()), 5) eq_(len(repo.get_commits(until='upstream')), 2) # Check number of tags @@ -178,7 +178,7 @@ def test_import_to_existing(self): eq_(mock_import([srpm]), 1) self._check_log(-1, 'Also check the --create-missing-branches') eq_(mock_import(['--no-pristine-tar', '--create-missing', srpm]), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) # Four commits: our initial, upstream and packaging files eq_(len(repo.get_commits()), 3) @@ -195,7 +195,7 @@ def test_filter(self): repo = GitRepository('gbp-test') files = set(['Makefile', 'dummy.sh', 'bar.tar.gz', 'foo.txt', 'gbp-test.spec', 'my.patch', 'my2.patch', 'my3.patch']) - self._check_repo_state(repo, 'master', ['master', 'upstream'], files) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream'], files) def test_tagging(self): """Test tag options of import-srpm""" @@ -321,7 +321,7 @@ def test_import_dir(self): eq_(mock_import(['--no-pristine-tar', 'gbp-test-1.0-1-unpack']), 0) # Check repository state repo = GitRepository('gbp-test') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) # Check that importing dir with multiple spec files fails eq_(mock_import(['multi-unpack']), 1) @@ -350,7 +350,7 @@ class TestDownloadImport(ComponentTestBase): def test_urldownload(self): """Test downloading and importing src.rpm from remote url""" srpm = 'http://raw.github.com/marquiz/git-buildpackage-rpm-testdata/'\ - 'master/gbp-test-1.0-1.src.rpm' + 'debian/latest/gbp-test-1.0-1.src.rpm' # Mock to use local files instead of really downloading local_fn = os.path.join(DATA_DIR, os.path.basename(srpm)) import_srpm.urlopen = Mock() @@ -359,7 +359,7 @@ def test_urldownload(self): eq_(mock_import(['--no-pristine-tar', srpm]), 0) # Check repository state repo = GitRepository('gbp-test') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) def test_nonexistent_url(self): """Test graceful failure when trying download from non-existent url""" @@ -397,7 +397,7 @@ def test_basic_import_pristine_tar(self): eq_(mock_import(['--pristine-tar', srpm]), 0) # Check repository state repo = GitRepository('gbp-test') - self._check_repo_state(repo, 'master', ['master', 'upstream', + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream', 'pristine-tar']) # Two commits: upstream and packaging files eq_(len(repo.get_commits()), 2) @@ -408,7 +408,7 @@ def test_unsupported_archive(self): eq_(mock_import(['--pristine-tar', srpm]), 0) # Check repository state repo = GitRepository('gbp-test-native') - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) # Check that a warning is printed self._check_log(-1, "gbp:warning: Ignoring pristine-tar") @@ -423,8 +423,8 @@ def test_basic_import_to_bare_repo(self): repo = GitRepository.create('myrepo', bare=True) os.chdir('myrepo') eq_(mock_import([srpm]), 0) - self._check_repo_state(repo, 'master', ['master', 'upstream']) + self._check_repo_state(repo, 'debian/latest', ['debian/latest', 'upstream']) # Patch import to bare repos not supported -> only 2 commits - eq_(len(repo.get_commits(until='master')), 2) + eq_(len(repo.get_commits(until='debian/latest')), 2) # vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: diff --git a/tests/component/rpm/test_pq_rpm.py b/tests/component/rpm/test_pq_rpm.py index 16044fdc..a36a44d4 100644 --- a/tests/component/rpm/test_pq_rpm.py +++ b/tests/component/rpm/test_pq_rpm.py @@ -73,200 +73,200 @@ def test_import_outside_repo(self): def test_import_export(self): """Basic test for patch import and export""" repo = self.init_test_repo('gbp-test') - branches = repo.get_local_branches() + ['patch-queue/master'] + branches = repo.get_local_branches() + ['patch-queue/debian/latest'] # Test import eq_(mock_pq(['import']), 0) files = ['AUTHORS', 'dummy.sh', 'Makefile', 'NEWS', 'README', 'mydir/myfile.txt'] patches = ['my.patch', '0001-my-gz.patch', '0002-my-bzip2.patch', '0003-my2.patch'] - branches.append('patch-queue/master') - self._check_repo_state(repo, 'patch-queue/master', branches, files) - eq_(repo.get_merge_base('upstream', 'patch-queue/master'), + branches.append('patch-queue/debian/latest') + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, files) + eq_(repo.get_merge_base('upstream', 'patch-queue/debian/latest'), repo.rev_parse('upstream')) ok_(len(repo.get_commits('', 'upstream')) < - len(repo.get_commits('', 'patch-queue/master'))) + len(repo.get_commits('', 'patch-queue/debian/latest'))) # Test export eq_(mock_pq(['export', '--upstream-tag', 'upstream/%(version)s']), 0) files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt', 'gbp-test.spec'] + patches - self._check_repo_state(repo, 'master', branches, files, clean=False) + self._check_repo_state(repo, 'debian/latest', branches, files, clean=False) eq_(repo.status()[' M'], [b'gbp-test.spec']) self._has_patches('gbp-test.spec', patches) # Another export after removing some patches os.unlink('0001-my-gz.patch') eq_(mock_pq(['export']), 0) - self._check_repo_state(repo, 'master', branches, files, clean=False) + self._check_repo_state(repo, 'debian/latest', branches, files, clean=False) self._has_patches('gbp-test.spec', patches) def test_import_export2(self): """Another test for import and export""" repo = self.init_test_repo('gbp-test2') - branches = repo.get_local_branches() + ['patch-queue/master-orphan'] - repo.set_branch('master-orphan') + branches = repo.get_local_branches() + ['patch-queue/debian/latest-orphan'] + repo.set_branch('debian/latest-orphan') # Import eq_(mock_pq(['import']), 0) files = ['dummy.sh', 'Makefile', 'README', 'mydir/myfile.txt'] patches = ['packaging/0001-PATCH-My-modification.patch', 'my.patch'] - self._check_repo_state(repo, 'patch-queue/master-orphan', branches, + self._check_repo_state(repo, 'patch-queue/debian/latest-orphan', branches, files) # Test export with --drop - branches.remove('patch-queue/master-orphan') + branches.remove('patch-queue/debian/latest-orphan') eq_(mock_pq(['export', '--drop', '--upstream-tag', 'upstream/%(version)s', '--spec-file', 'packaging/gbp-test2.spec']), 0) - self._check_repo_state(repo, 'master-orphan', branches, clean=False) + self._check_repo_state(repo, 'debian/latest-orphan', branches, clean=False) eq_(repo.status()[' M'], [b'packaging/gbp-test2.spec']) self._has_patches('packaging/gbp-test2.spec', patches) def test_rebase(self): """Basic test for rebase action""" repo = self.init_test_repo('gbp-test') - repo.rename_branch('pq/master', 'patch-queue/master') - repo.set_branch('patch-queue/master') + repo.rename_branch('pq/debian/latest', 'patch-queue/debian/latest') + repo.set_branch('patch-queue/debian/latest') branches = repo.get_local_branches() # Make development branch out-of-sync GitCommand("rebase")(['--onto', 'upstream^', 'upstream']) # Sanity check for our git rebase... - ok_(repo.get_merge_base('patch-queue/master', 'upstream') != + ok_(repo.get_merge_base('patch-queue/debian/latest', 'upstream') != repo.rev_parse('upstream')) # Do rebase eq_(mock_pq(['rebase']), 0) - self._check_repo_state(repo, 'patch-queue/master', branches) - ok_(repo.get_merge_base('patch-queue/master', 'upstream') == + self._check_repo_state(repo, 'patch-queue/debian/latest', branches) + ok_(repo.get_merge_base('patch-queue/debian/latest', 'upstream') == repo.rev_parse('upstream')) - # Get to out-of-sync, again, and try rebase from master branch + # Get to out-of-sync, again, and try rebase from debian/latest branch GitCommand("rebase")(['--onto', 'upstream^', 'upstream']) eq_(mock_pq(['switch']), 0) eq_(mock_pq(['rebase']), 0) - self._check_repo_state(repo, 'patch-queue/master', branches) - ok_(repo.get_merge_base('patch-queue/master', 'upstream') == + self._check_repo_state(repo, 'patch-queue/debian/latest', branches) + ok_(repo.get_merge_base('patch-queue/debian/latest', 'upstream') == repo.rev_parse('upstream')) def test_switch(self): """Basic test for switch action""" repo = self.init_test_repo('gbp-test') - branches = repo.get_local_branches() + ['patch-queue/master'] - repo.create_branch('patch-queue/master') + branches = repo.get_local_branches() + ['patch-queue/debian/latest'] + repo.create_branch('patch-queue/debian/latest') # Switch to base branch and back to pq eq_(mock_pq(['switch']), 0) - self._check_repo_state(repo, 'patch-queue/master', branches) + self._check_repo_state(repo, 'patch-queue/debian/latest', branches) eq_(mock_pq(['switch']), 0) - self._check_repo_state(repo, 'master', branches) + self._check_repo_state(repo, 'debian/latest', branches) def test_switch_drop(self): """Basic test for drop action""" repo = self.init_test_repo('gbp-test') - repo.rename_branch('pq/master', 'patch-queue/master') - repo.set_branch('patch-queue/master') + repo.rename_branch('pq/debian/latest', 'patch-queue/debian/latest') + repo.set_branch('patch-queue/debian/latest') branches = repo.get_local_branches() - # Switch to master + # Switch to debian/latest eq_(mock_pq(['switch']), 0) - self._check_repo_state(repo, 'master', branches) + self._check_repo_state(repo, 'debian/latest', branches) - # Drop should succeed when on master branch + # Drop should succeed when on debian/latest branch eq_(mock_pq(['drop']), 0) - branches.remove('patch-queue/master') - self._check_repo_state(repo, 'master', branches) + branches.remove('patch-queue/debian/latest') + self._check_repo_state(repo, 'debian/latest', branches) def test_drop_pq(self): """drop action should work on pq branch""" repo = self.init_test_repo('gbp-test') - repo.rename_branch('pq/master', 'patch-queue/master') - repo.set_branch('patch-queue/master') + repo.rename_branch('pq/debian/latest', 'patch-queue/debian/latest') + repo.set_branch('patch-queue/debian/latest') branches = repo.get_local_branches() - # Switch to master + # Switch to debian/latest eq_(mock_pq(['switch']), 0) - self._check_repo_state(repo, 'master', branches) + self._check_repo_state(repo, 'debian/latest', branches) - # Drop should succeed when on master branch + # Drop should succeed when on debian/latest branch eq_(mock_pq(['drop']), 0) - branches.remove('patch-queue/master') - self._check_repo_state(repo, 'master', branches) + branches.remove('patch-queue/debian/latest') + self._check_repo_state(repo, 'debian/latest', branches) def test_force_import(self): """Test force import""" repo = self.init_test_repo('gbp-test') pkg_files = [f.decode() for f in repo.list_files()] - repo.rename_branch('pq/master', 'patch-queue/master') - repo.set_branch('patch-queue/master') + repo.rename_branch('pq/debian/latest', 'patch-queue/debian/latest') + repo.set_branch('patch-queue/debian/latest') branches = repo.get_local_branches() pq_files = [f.decode() for f in repo.list_files()] # Re-import should fail eq_(mock_pq(['import']), 1) self._check_log(0, "gbp:error: Already on a patch-queue branch") - self._check_repo_state(repo, 'patch-queue/master', branches, pq_files) + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, pq_files) # Mangle pq branch and try force import on top of that - repo.force_head('master', hard=True) - self._check_repo_state(repo, 'patch-queue/master', branches, pkg_files) + repo.force_head('debian/latest', hard=True) + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, pkg_files) eq_(mock_pq(['import', '--force']), 0) # .gbp.conf won't get imported by pq pq_files.remove('.gbp.conf') - self._check_repo_state(repo, 'patch-queue/master', branches, pq_files) + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, pq_files) - # Switch back to master + # Switch back to debian/latest eq_(mock_pq(['switch']), 0) - self._check_repo_state(repo, 'master', branches, pkg_files) + self._check_repo_state(repo, 'debian/latest', branches, pkg_files) # Import should fail eq_(mock_pq(['import']), 1) self._check_log(-1, "gbp:error: Patch-queue branch .* already exists") - self._check_repo_state(repo, 'master', branches, pkg_files) + self._check_repo_state(repo, 'debian/latest', branches, pkg_files) # Force import should succeed eq_(mock_pq(['import', '--force']), 0) - self._check_repo_state(repo, 'patch-queue/master', branches, pq_files) + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, pq_files) def test_apply(self): """Basic test for apply action""" repo = self.init_test_repo('gbp-test') upstr_files = ['dummy.sh', 'Makefile', 'README'] - branches = repo.get_local_branches() + ['patch-queue/master'] + branches = repo.get_local_branches() + ['patch-queue/debian/latest'] # No patch given eq_(mock_pq(['apply']), 1) self._check_log(-1, "gbp:error: No patch name given.") # Create a pristine pq-branch - repo.create_branch('patch-queue/master', 'upstream') + repo.create_branch('patch-queue/debian/latest', 'upstream') # Apply patch with tempfile.NamedTemporaryFile() as tmp_patch: - tmp_patch.write(repo.show('master:%s' % 'my.patch')) + tmp_patch.write(repo.show('debian/latest:%s' % 'my.patch')) tmp_patch.file.flush() eq_(mock_pq(['apply', tmp_patch.name]), 0) - self._check_repo_state(repo, 'patch-queue/master', branches, + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, upstr_files) # Apply another patch, now when already on pq branch with tempfile.NamedTemporaryFile() as tmp_patch: - tmp_patch.write(repo.show('master:%s' % 'my2.patch')) + tmp_patch.write(repo.show('debian/latest:%s' % 'my2.patch')) tmp_patch.file.flush() eq_(mock_pq(['apply', tmp_patch.name]), 0) - self._check_repo_state(repo, 'patch-queue/master', branches, + self._check_repo_state(repo, 'patch-queue/debian/latest', branches, upstr_files + ['mydir/myfile.txt']) def test_option_patch_numbers(self): """Test the --patch-numbers cmdline option""" repo = self.init_test_repo('gbp-test') - repo.rename_branch('pq/master', 'patch-queue/master') + repo.rename_branch('pq/debian/latest', 'patch-queue/debian/latest') branches = repo.get_local_branches() # Export eq_(mock_pq(['export', '--no-patch-numbers']), 0) patches = ['my-gz.patch', 'my-bzip2.patch', 'my2.patch', 'my.patch'] files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt', 'gbp-test.spec'] + patches - self._check_repo_state(repo, 'master', branches, files, clean=False) + self._check_repo_state(repo, 'debian/latest', branches, files, clean=False) self._has_patches('gbp-test.spec', patches) def test_option_tmp_dir(self): @@ -325,15 +325,15 @@ def test_option_packaging_dir(self): def test_export_with_merges(self): """Test exporting pq-branch with merge commits""" repo = self.init_test_repo('gbp-test') - repo.rename_branch('pq/master', 'patch-queue/master') - repo.set_branch('patch-queue/master') + repo.rename_branch('pq/debian/latest', 'patch-queue/debian/latest') + repo.set_branch('patch-queue/debian/latest') branches = repo.get_local_branches() # Create a merge commit in pq-branch patches = repo.format_patches('HEAD^', 'HEAD', '.') repo.force_head('HEAD^', hard=True) - repo.commit_dir('.', 'Merge with master', 'patch-queue/master', - ['master']) + repo.commit_dir('.', 'Merge with debian/latest', 'patch-queue/debian/latest', + ['debian/latest']) merge_rev = repo.rev_parse('HEAD', short=7) eq_(mock_pq(['apply', patches[0].decode()]), 0) upstr_rev = repo.rev_parse('upstream', short=7) @@ -345,7 +345,7 @@ def test_export_with_merges(self): '%s-to-%s.diff' % (upstr_rev, merge_rev), '0002-my2.patch'] files = ['.gbp.conf', '.gitignore', 'bar.tar.gz', 'foo.txt', 'gbp-test.spec'] + patches - self._check_repo_state(repo, 'master', branches, files, clean=False) + self._check_repo_state(repo, 'debian/latest', branches, files, clean=False) self._has_patches('gbp-test.spec', patches) def test_import_unapplicable_patch(self): @@ -357,11 +357,11 @@ def test_import_unapplicable_patch(self): patch_file.write('-this-does\n+not-apply\n') eq_(mock_pq(['import']), 1) self._check_log(-2, "Please commit your changes or stash them") - self._check_repo_state(repo, 'master', branches, clean=False) + self._check_repo_state(repo, 'debian/latest', branches, clean=False) # Now commit the changes to the patch and try again repo.add_files(['my2.patch'], force=True) repo.commit_files(['my2.patch'], msg="Mangle patch") eq_(mock_pq(['import']), 1) self._check_log(-1, "gbp:error: Import failed: Error running git apply") - self._check_repo_state(repo, 'master', branches, clean=False) + self._check_repo_state(repo, 'debian/latest', branches, clean=False) diff --git a/tests/component/rpm/test_rpm_ch.py b/tests/component/rpm/test_rpm_ch.py index 97f5d7e6..598c7af0 100644 --- a/tests/component/rpm/test_rpm_ch.py +++ b/tests/component/rpm/test_rpm_ch.py @@ -33,7 +33,7 @@ def mock_ch(args): """Wrapper for gbp-rpm-ch""" with capture_stderr(): - return rpm_ch(['arg0', '--packaging-branch=master', + return rpm_ch(['arg0', '--packaging-branch=debian/latest', '--spawn-editor=never'] + args) diff --git a/tests/doctests/test_GitRepository.py b/tests/doctests/test_GitRepository.py index 3052b860..4e349412 100644 --- a/tests/doctests/test_GitRepository.py +++ b/tests/doctests/test_GitRepository.py @@ -376,9 +376,9 @@ def test_find_branch_tag(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.find_branch_tag('HEAD', 'master', 'tag*') + >>> repo.find_branch_tag('HEAD', 'debian/latest', 'tag*') 'tag2' - >>> repo.find_branch_tag('HEAD', 'master', 'v*') # doctest:+ELLIPSIS + >>> repo.find_branch_tag('HEAD', 'debian/latest', 'v*') # doctest:+ELLIPSIS Traceback (most recent call last): ... gbp.git.repository.GitRepositoryError: Can't describe .... Git error: fatal: No names found, cannot describe anything. @@ -604,14 +604,14 @@ def test_mirror_clone(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.set_branch('master') + >>> repo.set_branch('debian/latest') >>> repo.branch - 'master' + 'debian/latest' >>> mirror = gbp.git.GitRepository.clone(dirs['mirror_clone'], repo.path, mirror=True) >>> mirror.is_empty() False >>> mirror.branch - 'master' + 'debian/latest' >>> mirror.has_branch('foo') True >>> mirror.has_branch('bar') @@ -640,30 +640,30 @@ def test_clone(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.set_branch('master') + >>> repo.set_branch('debian/latest') >>> clone = gbp.git.GitRepository.clone(dirs['clone'], repo.path) >>> clone.is_empty() False >>> clone.branch - 'master' + 'debian/latest' >>> clone.get_remote_branches() - ['origin', 'origin/foo', 'origin/master'] + ['origin', 'origin/foo', 'origin/debian/latest'] >>> clone.get_local_branches() - ['master'] - >>> clone.get_merge_branch('master') - 'origin/master' + ['debian/latest'] + >>> clone.get_merge_branch('debian/latest') + 'origin/debian/latest' >>> clone.create_branch('foo', 'origin/foo') >>> clone.get_merge_branch('foo') 'origin/foo' >>> clone.create_branch('bar') >>> clone.get_merge_branch('bar') # None if no merge branch exists >>> clone.get_local_branches() - ['bar', 'foo', 'master'] + ['bar', 'foo', 'debian/latest'] >>> clone.get_remote_repos() ['origin'] >>> clone.has_remote_repo('origin') True - >>> clone.has_branch('origin/master', remote=True) + >>> clone.has_branch('origin/debian/latest', remote=True) True >>> clone.has_remote_repo('godiug') False @@ -703,7 +703,7 @@ def test_merge(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.set_branch('master') + >>> repo.set_branch('debian/latest') >>> repo.merge('foo') >>> repo.is_in_merge() False @@ -721,7 +721,7 @@ def test_pull(): >>> import gbp.git, os >>> d = os.path.join(dirs['clone'], 'repo') >>> clone = gbp.git.GitRepository(d) - >>> clone.set_branch('master') + >>> clone.set_branch('debian/latest') >>> clone.pull() >>> clone.pull(all_remotes=True) >>> clone.pull('origin', all_remotes=True) @@ -746,17 +746,17 @@ def test_fetch(): >>> clone.push() >>> clone.push('origin', dry_run=True) >>> clone.push('origin') - >>> clone.push('origin', 'master') - >>> clone.push('origin', 'master', force=True) + >>> clone.push('origin', 'debian/latest') + >>> clone.push('origin', 'debian/latest', force=True) >>> clone.create_tag('tag3') >>> clone.push_tag('origin', 'tag3', True) >>> clone.push_tag('origin', 'tag3') >>> clone.create_tag('tag4') - >>> clone.push('origin', 'master', tags=True) + >>> clone.push('origin', 'debian/latest', tags=True) >>> clone.add_remote_repo('foo', dirs['repo']) >>> clone.fetch('foo') >>> clone.fetch('foo', tags=True) - >>> clone.fetch('foo', refspec='refs/heads/master') + >>> clone.fetch('foo', refspec='refs/heads/debian/latest') >>> clone.fetch(all_remotes=True) >>> clone.remove_remote_repo('foo') """ @@ -831,17 +831,17 @@ def test_checkout(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.checkout('master') + >>> repo.checkout('debian/latest') >>> repo.branch - 'master' + 'debian/latest' >>> repo.rev_parse('doesnotexist') Traceback (most recent call last): ... gbp.git.repository.GitRepositoryError: revision 'doesnotexist' not found - >>> sha1 = repo.rev_parse('master', short=10) + >>> sha1 = repo.rev_parse('debian/latest', short=10) >>> len(sha1) 10 - >>> sha1 = repo.rev_parse('master') + >>> sha1 = repo.rev_parse('debian/latest') >>> len(sha1) 40 >>> repo.checkout(sha1) @@ -880,10 +880,10 @@ def test_grep_log(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.set_branch('master') + >>> repo.set_branch('debian/latest') >>> len(repo.grep_log('foo')) == 2 True - >>> len(repo.grep_log('foo', 'master')) == 2 + >>> len(repo.grep_log('foo', 'debian/latest')) == 2 True >>> repo.grep_log('blafasel') [] @@ -903,12 +903,12 @@ def test_is_ff(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.is_fast_forward('master', 'foo') + >>> repo.is_fast_forward('debian/latest', 'foo') (True, True) >>> repo.create_branch('ff', 'HEAD^') - >>> repo.is_fast_forward('ff', 'master') + >>> repo.is_fast_forward('ff', 'debian/latest') (True, False) - >>> repo.is_fast_forward('master', 'ff') + >>> repo.is_fast_forward('debian/latest', 'ff') (False, True) """ @@ -922,7 +922,7 @@ def test_update_ref(): >>> import gbp.git, os >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> repo.update_ref('new_ref', 'master', msg='update') + >>> repo.update_ref('new_ref', 'debian/latest', msg='update') >>> os.path.exists(os.path.join(repo.git_dir, 'new_ref')) True """ @@ -983,10 +983,10 @@ def test_get_merge_base(): >>> import gbp.git >>> repo = gbp.git.GitRepository(dirs['repo']) - >>> sha1 = repo.get_merge_base('master', 'foo') + >>> sha1 = repo.get_merge_base('debian/latest', 'foo') >>> len(sha1) 40 - >>> repo.get_merge_base('master', 'doesnotexist') + >>> repo.get_merge_base('debian/latest', 'doesnotexist') Traceback (most recent call last): ... gbp.git.repository.GitRepositoryError: Failed to get common ancestor: fatal: Not a valid object name doesnotexist