Skip to content

Commit

Permalink
Change from --dist-extra-repos to --dist-repos and related (TriBITSPu…
Browse files Browse the repository at this point in the history
…b#151)

* Changes --dist-extra-repos to --dist-repos and handles the base repo as
  '.'.

* .gitdist[.dists] file must now list the base repo explicitly as '.'.

* Changes --dist-not-extra-repos to --dist-not-repos (which can now list the
  base repo as '.') and removes the option --dist-not-base-repo.

This is MAJOR change in that it breaks backward compatibility.

See more details in TriBITS GitHub TriBITSPub#151.

Build/Test Cases Summary
Enabled Packages:
Enabled all Packages
0) MPI_DEBUG => passed: passed=222,notpassed=0 (0.42 min)
1) SERIAL_RELEASE => passed: passed=222,notpassed=0 (0.37 min)
Other local commits for this build/test group: 5cfca62, c46f1d3
  • Loading branch information
bartlettroscoe committed Nov 3, 2016
1 parent 5cfca62 commit fecd692
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 129 deletions.
1 change: 1 addition & 0 deletions .gitdist.default
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.
TriBITSDoc
54 changes: 28 additions & 26 deletions test/python_utils/gitdist_UnitTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ def test_dot_gitdist(self):

# Make sure .gitdist.default is found and read correctly
open(".gitdist.default", "w").write(
".\n" \
"ExtraRepo1\n" \
"Path/To/ExtraRepo2\n" \
"MissingExtraRep\n" \
Expand All @@ -783,6 +784,7 @@ def test_dot_gitdist(self):

# Make sure that .gitdist overrides .gitdist.default
open(".gitdist", "w").write(
".\n" \
"ExtraRepo1\n" \
"ExtraRepo3\n"
)
Expand All @@ -797,9 +799,9 @@ def test_dot_gitdist(self):
"['mockgit', 'status']\n\n"
self.assertEqual(cmndOut, b(cmndOut_expected))

# Make sure that --dist-extra-repos overrides all files
# Make sure that --dist-repos overrides all files
cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPathMock+" --dist-extra-repos=ExtraRepo1,Path/To/ExtraRepo2 status",
gitdistPathMock+" --dist-repos=.,ExtraRepo1,Path/To/ExtraRepo2 status",
workingDir=testDir)
cmndOut_expected = \
"\n*** Base Git Repo: MockProjectDir\n" \
Expand All @@ -816,7 +818,7 @@ def test_dot_gitdist(self):

def test_log_args_extra_repo_1(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+" --dist-extra-repos=extraTrilinosRepo log HEAD -1")
gitdistPathMock+" --dist-repos=.,extraTrilinosRepo log HEAD -1")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n" \
"['mockgit', 'log', 'HEAD', '-1']\n\n" \
Expand All @@ -828,8 +830,8 @@ def test_log_args_extra_repo_1(self):
def test_log_args_extra_repo_2_not_first(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+\
" --dist-extra-repos=extraTrilinosRepo,extraRepoOnePackage "+\
" --dist-not-extra-repos=extraTrilinosRepo "+\
" --dist-repos=.,extraTrilinosRepo,extraRepoOnePackage "+\
" --dist-not-repos=extraTrilinosRepo "+\
" log HEAD -1"
)
cmndOut_expected = \
Expand All @@ -843,8 +845,8 @@ def test_log_args_extra_repo_2_not_first(self):
def test_log_args_extra_repo_2_not_second(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+\
" --dist-extra-repos=extraTrilinosRepo,extraRepoOnePackage "+\
" --dist-not-extra-repos=extraTrilinosRepo "+\
" --dist-repos=.,extraTrilinosRepo,extraRepoOnePackage "+\
" --dist-not-repos=extraTrilinosRepo "+\
" log HEAD -1"
)
cmndOut_expected = \
Expand All @@ -858,8 +860,8 @@ def test_log_args_extra_repo_2_not_second(self):
def test_log_args_extra_repo_1_not_base(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+\
" --dist-extra-repos=extraTrilinosRepo "+\
" --dist-not-base-repo "+\
" --dist-repos=.,extraTrilinosRepo "+\
" --dist-not-repos=. "+\
" log HEAD -1"
)
cmndOut_expected = \
Expand Down Expand Up @@ -930,7 +932,7 @@ def test_dist_mod_only_1_change_base(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-mod-only --dist-extra-repos=ExtraRepo1,ExtraRepo2 status",
+" --dist-mod-only --dist-repos=.,ExtraRepo1,ExtraRepo2 status",
workingDir=testDir)
cmndOut_expected = \
"\n*** Base Git Repo: MockProjectDir\n" \
Expand Down Expand Up @@ -1004,7 +1006,7 @@ def test_dist_mod_only_1_change_extrarepo1(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-mod-only --dist-extra-repos=ExtraRepo1,ExtraRepo2 status",
+" --dist-mod-only --dist-repos=.,ExtraRepo1,ExtraRepo2 status",
workingDir=testDir)
cmndOut_expected = \
"\n*** Git Repo: ExtraRepo1\nOn branch local_branch1\n" \
Expand Down Expand Up @@ -1058,7 +1060,7 @@ def test_dist_mod_only_1_extrarepo1_not_tracking_branch(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-mod-only --dist-extra-repos=ExtraRepo1,ExtraRepo2 status",
+" --dist-mod-only --dist-repos=.,ExtraRepo1,ExtraRepo2 status",
workingDir=testDir)
cmndOut_expected = \
"\n*** Base Git Repo: MockProjectDir\n" \
Expand Down Expand Up @@ -1111,10 +1113,10 @@ def test_dist_mod_only_1_extrarepo1_not_tracking_branch_with_mods(self):
"Your branch is ahead of 'origin_repo1/remote_branch1' by 1 commits.\n" \
)

# Make sure that --dist-extra-repos overrides all files
# Make sure that --dist-repos overrides all files
cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-mod-only --dist-extra-repos=ExtraRepo1,ExtraRepo2 status",
+" --dist-mod-only --dist-repos=.,ExtraRepo1,ExtraRepo2 status",
workingDir=testDir)
cmndOut_expected = \
"\n*** Git Repo: ExtraRepo1\n" \
Expand All @@ -1141,7 +1143,7 @@ def test_log_version_file_extra_repo_1(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+ \
" --dist-version-file="+unitTestDataDir+"/versionFile_withSummary_1.txt"+ \
" --dist-extra-repos=extraTrilinosRepo"+ \
" --dist-repos=.,extraTrilinosRepo"+ \
" log _VERSION_")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n" \
Expand All @@ -1154,7 +1156,7 @@ def test_log_version_file_extra_repo_2(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+ \
" --dist-version-file="+unitTestDataDir+"/versionFile_withSummary_1.txt"+ \
" --dist-extra-repos=extraRepoOnePackage,extraTrilinosRepo"+ \
" --dist-repos=.,extraRepoOnePackage,extraTrilinosRepo"+ \
" log _VERSION_")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n" \
Expand All @@ -1168,7 +1170,7 @@ def test_log_HEAD_version_file_extra_repo_1(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+ \
" --dist-version-file="+unitTestDataDir+"/versionFile_withSummary_1.txt"+ \
" --dist-extra-repos=extraTrilinosRepo"+ \
" --dist-repos=.,extraTrilinosRepo"+ \
" log HEAD ^_VERSION_")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n" \
Expand All @@ -1181,11 +1183,11 @@ def test_version_file_invalid_extra_repo(self):
cmndOut = getCmndOutputInMockProjectDir(
gitdistPathMock+ \
" --dist-version-file="+unitTestDataDir+"/versionFile_withSummary_1.txt"+ \
" --dist-extra-repos=extraRepoTwoPackages"+ \
" --dist-repos=.,extraRepoTwoPackages"+ \
" log _VERSION_")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n['mockgit', 'log', 'sha1_1']\n" \
"\n*** Git Repo: extraRepoTwoPackages\nExtra repo 'extraRepoTwoPackages' is not in the list of extra repos ['extraTrilinosRepo', 'extraRepoOnePackage'] read in from version file.\n"
"\n*** Git Repo: extraRepoTwoPackages\nRepo 'extraRepoTwoPackages' is not in the list of repos ['.', 'extraRepoOnePackage', 'extraTrilinosRepo'] read in from the version file.\n"
self.assertEqual(cmndOut, b(cmndOut_expected))


Expand All @@ -1206,7 +1208,7 @@ def test_log_not_version_file_2_extra_repo_1(self):
gitdistPathMock+ \
" --dist-version-file="+unitTestDataDir+"/versionFile_withSummary_1.txt"+ \
" --dist-version-file2="+unitTestDataDir+"/versionFile_withSummary_1_2.txt"+ \
" --dist-extra-repos=extraTrilinosRepo"+ \
" --dist-repos=.,extraTrilinosRepo"+ \
" log _VERSION_ ^_VERSION2_")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n" \
Expand All @@ -1220,7 +1222,7 @@ def test_log_since_until_version_file_2_extra_repo_1(self):
gitdistPathMock+ \
" --dist-version-file="+unitTestDataDir+"/versionFile_withSummary_1.txt"+ \
" --dist-version-file2="+unitTestDataDir+"/versionFile_withSummary_1_2.txt"+ \
" --dist-extra-repos=extraTrilinosRepo"+ \
" --dist-repos=.,extraTrilinosRepo"+ \
" log _VERSION2_.._VERSION_")
cmndOut_expected = \
"\n*** Base Git Repo: MockTrilinos\n" \
Expand All @@ -1245,7 +1247,7 @@ def test_dist_repo_status_all(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-extra-repos=ExtraRepo1,ExtraRepo2 dist-repo-status",
+" --dist-repos=.,ExtraRepo1,ExtraRepo2 dist-repo-status",
workingDir=testDir)
#print(cmndOut)
cmndOut_expected = \
Expand Down Expand Up @@ -1279,7 +1281,7 @@ def test_dist_repo_status_mod_only_first(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-extra-repos=ExtraRepo1,ExtraRepo2 --dist-mod-only dist-repo-status",
+" --dist-repos=.,ExtraRepo1,ExtraRepo2 --dist-mod-only dist-repo-status",
workingDir=testDir)
#print(cmndOut)
cmndOut_expected = \
Expand Down Expand Up @@ -1312,7 +1314,7 @@ def test_dist_repo_status_mod_only_first_legend(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-extra-repos=ExtraRepo1,ExtraRepo2 --dist-mod-only" \
+" --dist-repos=.,ExtraRepo1,ExtraRepo2 --dist-mod-only" \
+" --dist-legend dist-repo-status",
workingDir=testDir)
#print("+++++++++\n" + cmndOut + "+++++++\n")
Expand Down Expand Up @@ -1353,7 +1355,7 @@ def test_dist_repo_status_mod_only_first_last(self):

cmndOut = GeneralScriptSupport.getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-extra-repos=ExtraRepo1,ExtraRepo2 --dist-mod-only dist-repo-status",
+" --dist-repos=.,ExtraRepo1,ExtraRepo2 --dist-mod-only dist-repo-status",
workingDir=testDir)
#print(cmndOut)
cmndOut_expected = \
Expand Down Expand Up @@ -1381,7 +1383,7 @@ def test_dist_repo_status_extra_args_fail(self):

(cmndOut, errOut) = getCmndOutput(
gitdistPath + " --dist-no-color --dist-use-git="+mockGitPath \
+" --dist-extra-repos=ExtraRepo1,ExtraRepo2 --dist-mod-only" \
+" --dist-repos=.,ExtraRepo1,ExtraRepo2 --dist-mod-only" \
+" --dist-legend dist-repo-status --name-status",
rtnCode=True)
#print(cmndOut)
Expand Down
6 changes: 6 additions & 0 deletions tribits/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Release Notes for TriBITS

2016/11/02:

(*) MAJOR: gitdist now accepts --dist-repos and --dist-not-repos arguments and
requires that the base repo '.' be explicitly listed in the
.gitdist[.default] files and in --dist-repos. The arguments
--dist-extra-repos, --dist-not-extra-repos and --dist-not-base-repo are
not longer supported. See gitdist --help for more details.

(*) MINOR: TriBITS projects now install with full RPATH set by default (see
"Setting install RPATH" in build reference guide).

Expand Down
Loading

0 comments on commit fecd692

Please sign in to comment.