From f2c1d696f94eef9348269005e1ce91384c3be2e6 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 28 Feb 2015 21:31:24 +0000 Subject: [PATCH] Follow-up to r1661252: Also consider revisions committed directly to the branch valid. * tools/dist/backport.pl (backport_usage): Update documentation. (validate_branch_contains_named_revisions): Include revisions committed directly to the branch in the set of 'present' revisions. * tools/dist/backport_branch_with_original_revision.dump: New file. * tools/dist/backport_tests.py (backport_branch_with_original_revision): New test. git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1663005 13f79535-47bb-0310-9956-ffa450edef68 --- tools/dist/backport.pl | 8 +- ...ackport_branch_with_original_revision.dump | 672 ++++++++++++++++++ tools/dist/backport_tests.py | 39 + 3 files changed, 716 insertions(+), 3 deletions(-) create mode 100644 tools/dist/backport_branch_with_original_revision.dump diff --git a/tools/dist/backport.pl b/tools/dist/backport.pl index 0c5f6be6ba735..ff663d9528231 100755 --- a/tools/dist/backport.pl +++ b/tools/dist/backport.pl @@ -203,8 +203,9 @@ sub backport_usage { Both batch modes also perform a basic sanity-check on entries that declare backport branches (via the "Branch:" header): if a backport branch is used, but -at least one of the revisions enumerated in the entry title had not been merged -from $TRUNK to the branch root, the hourly bot will turn red and +at least one of the revisions enumerated in the entry title had neither been +merged from $TRUNK to the branch root, nor been committed +directly to the backport branch, the hourly bot will turn red and nightly bot will skip the entry and email its admins. (The nightly bot does not email the list on failure, since it doesn't use buildbot.) @@ -895,7 +896,8 @@ sub validate_branch_contains_named_revisions { my $shell_escaped_branch = shell_escape($entry{branch}); %present = do { - my @present = `$SVN mergeinfo --show-revs=merged -- $TRUNK $BRANCHES/$shell_escaped_branch`; + my @present = `$SVN mergeinfo --show-revs=merged -- $TRUNK $BRANCHES/$shell_escaped_branch && + $SVN mergeinfo --show-revs=eligible -- $BRANCHES/$shell_escaped_branch`; chomp @present; @present = map /(\d+)/g, @present; map +($_ => 1), @present; diff --git a/tools/dist/backport_branch_with_original_revision.dump b/tools/dist/backport_branch_with_original_revision.dump new file mode 100644 index 0000000000000..169b53c8a89ba --- /dev/null +++ b/tools/dist/backport_branch_with_original_revision.dump @@ -0,0 +1,672 @@ +SVN-fs-dump-format-version: 2 + +UUID: d401d159-515a-4461-be2f-1d66eda6f451 + +Revision-number: 0 +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + +Revision-number: 1 +Prop-content-length: 83 +Content-length: 83 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 27 +Log message for revision 1. +PROPS-END + +Node-path: A +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/B +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/B/E +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/B/E/alpha +Node-kind: file +Node-action: add +Text-content-md5: d1fa4a3ced98961674a441930a51f2d3 +Text-content-sha1: b347d1da69df9a6a70433ceeaa0d46c8483e8c03 +Prop-content-length: 10 +Text-content-length: 26 +Content-length: 36 + +PROPS-END +This is the file 'alpha'. + + +Node-path: A/B/E/beta +Node-kind: file +Node-action: add +Text-content-md5: 67c756078f24f946f6ec2d00d02f50e1 +Text-content-sha1: d001710ac8e622c6d1fe59b1e265a3908acdd2a3 +Prop-content-length: 10 +Text-content-length: 25 +Content-length: 35 + +PROPS-END +This is the file 'beta'. + + +Node-path: A/B/F +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/B/lambda +Node-kind: file +Node-action: add +Text-content-md5: 911c7a8d869b8c1e566f57da54d889c6 +Text-content-sha1: 784a9298366863da2b65ebf82b4e1123755a2421 +Prop-content-length: 10 +Text-content-length: 27 +Content-length: 37 + +PROPS-END +This is the file 'lambda'. + + +Node-path: A/C +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/D +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/D/G +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/D/G/pi +Node-kind: file +Node-action: add +Text-content-md5: adddfc3e6b605b5f90ceeab11b4e8ab6 +Text-content-sha1: 411e258dc14b42701fdc29b75f653e93f8686415 +Prop-content-length: 10 +Text-content-length: 23 +Content-length: 33 + +PROPS-END +This is the file 'pi'. + + +Node-path: A/D/G/rho +Node-kind: file +Node-action: add +Text-content-md5: 82f2211cf4ab22e3555fc7b835fbc604 +Text-content-sha1: 56388a031dffbf9df7c32e1f299b1d5d7ef60881 +Prop-content-length: 10 +Text-content-length: 24 +Content-length: 34 + +PROPS-END +This is the file 'rho'. + + +Node-path: A/D/G/tau +Node-kind: file +Node-action: add +Text-content-md5: 9936e2716e469bb686deb98c280ead58 +Text-content-sha1: 62e8c07d56bee94ea4577e80414fa8805aaf0175 +Prop-content-length: 10 +Text-content-length: 24 +Content-length: 34 + +PROPS-END +This is the file 'tau'. + + +Node-path: A/D/H +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: A/D/H/chi +Node-kind: file +Node-action: add +Text-content-md5: 8f5ebad6d1f7775c2682e54417cbe4d3 +Text-content-sha1: abeac1bf62099ab66b44779198dc19f40e3244f4 +Prop-content-length: 10 +Text-content-length: 24 +Content-length: 34 + +PROPS-END +This is the file 'chi'. + + +Node-path: A/D/H/omega +Node-kind: file +Node-action: add +Text-content-md5: fe4ec8bdd3d2056db4f55b474a10fadc +Text-content-sha1: c06e671bf15a6af55086176a0931d3b5034c82e6 +Prop-content-length: 10 +Text-content-length: 26 +Content-length: 36 + +PROPS-END +This is the file 'omega'. + + +Node-path: A/D/H/psi +Node-kind: file +Node-action: add +Text-content-md5: e81f8f68ba50e749c200cb3c9ce5d2b1 +Text-content-sha1: 9c438bde39e8ccbbd366df2638e3cb6700950204 +Prop-content-length: 10 +Text-content-length: 24 +Content-length: 34 + +PROPS-END +This is the file 'psi'. + + +Node-path: A/D/gamma +Node-kind: file +Node-action: add +Text-content-md5: 412138bd677d64cd1c32fafbffe6245d +Text-content-sha1: 74b75d7f2e1a0292f17d5a57c570bd89783f5d1c +Prop-content-length: 10 +Text-content-length: 26 +Content-length: 36 + +PROPS-END +This is the file 'gamma'. + + +Node-path: A/mu +Node-kind: file +Node-action: add +Text-content-md5: baf78ae06a2d5b7d9554c5f1280d3fa8 +Text-content-sha1: b4d00c56351d1a752e24d839d41a362d8da4a4c7 +Prop-content-length: 10 +Text-content-length: 23 +Content-length: 33 + +PROPS-END +This is the file 'mu'. + + +Node-path: iota +Node-kind: file +Node-action: add +Text-content-md5: 2d18c5e57e84c5b8a5e9a6e13fa394dc +Text-content-sha1: 2c0aa9014a0cd07f01795a333d82485ef6d083e2 +Prop-content-length: 10 +Text-content-length: 25 +Content-length: 35 + +PROPS-END +This is the file 'iota'. + + +Revision-number: 2 +Prop-content-length: 68 +Content-length: 68 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 12 +Create trunk +PROPS-END + +Node-path: subversion +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: subversion/branches +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: subversion/tags +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: subversion/trunk +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: subversion/trunk/A +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 1 +Node-copyfrom-path: A + + +Node-path: subversion/trunk/iota +Node-kind: file +Node-action: add +Node-copyfrom-rev: 1 +Node-copyfrom-path: iota +Text-copy-source-md5: 2d18c5e57e84c5b8a5e9a6e13fa394dc +Text-copy-source-sha1: 2c0aa9014a0cd07f01795a333d82485ef6d083e2 + + +Node-path: A +Node-action: delete + + +Node-path: iota +Node-action: delete + + +Revision-number: 3 +Prop-content-length: 87 +Content-length: 87 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 31 +Create branch, with STATUS file +PROPS-END + +Node-path: branch +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 2 +Node-copyfrom-path: subversion/trunk + + +Node-path: branch/STATUS +Node-kind: file +Node-action: add +Text-content-md5: d41d8cd98f00b204e9800998ecf8427e +Text-content-sha1: da39a3ee5e6b4b0d3255bfef95601890afd80709 +Prop-content-length: 10 +Text-content-length: 0 +Content-length: 10 + +PROPS-END + + +Revision-number: 4 +Prop-content-length: 68 +Content-length: 68 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 12 +First change +PROPS-END + +Node-path: subversion/trunk/iota +Node-kind: file +Node-action: change +Text-content-md5: 67f471c2ecc2c9e561d122d6e6b0f847 +Text-content-sha1: 750accb6e7f880a1d05ce725c19eb60183bb4b26 +Text-content-length: 38 +Content-length: 38 + +This is the file 'iota'. +First change + + +Revision-number: 5 +Prop-content-length: 69 +Content-length: 69 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 13 +Second change +PROPS-END + +Node-path: subversion/trunk/A/mu +Node-kind: file +Node-action: change +Text-content-md5: eab751301b4e650c83324dfef4aad667 +Text-content-sha1: ab36cad564c7c50dec5ac1eb0bf879cf4e3a5f99 +Text-content-length: 37 +Content-length: 37 + +This is the file 'mu'. +Second change + + +Revision-number: 6 +Prop-content-length: 82 +Content-length: 82 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 26 +Conflicting change on iota +PROPS-END + +Node-path: branch/iota +Node-kind: file +Node-action: change +Text-content-md5: 2309abeef2762865a65aef15a23bd613 +Text-content-sha1: d3339d12dee6df117675e9abf30ebfa1a1dde889 +Text-content-length: 52 +Content-length: 52 + +This is the file 'iota'. +Conflicts with first change + +Revision-number: 7 +Prop-content-length: 80 +Content-length: 80 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 24 +Create a backport branch +PROPS-END + +Node-path: subversion/branches/r4 +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 6 +Node-copyfrom-path: branch + + +Revision-number: 8 +Prop-content-length: 85 +Content-length: 85 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 29 +Conflict resolution via mkdir +PROPS-END + +Node-path: subversion/branches/r4 +Node-kind: dir +Node-action: change +Prop-content-length: 54 +Content-length: 54 + +K 13 +svn:mergeinfo +V 19 +/subversion/trunk:4 +PROPS-END + + +Node-path: subversion/branches/r4/A_resolved +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Node-path: subversion/branches/r4/iota +Node-kind: file +Node-action: change +Text-content-md5: 1d0413d4da6866dae63f902165786614 +Text-content-sha1: e2cb0815ec8f0a8b36c6aa910c1f894ec1487da3 +Text-content-length: 9 +Content-length: 9 + +resolved + + +Revision-number: 9 +Prop-content-length: 99 +Content-length: 99 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 43 +An original revision on the backport branch +PROPS-END + +Node-path: subversion/branches/r4/dir-created-on-backport-branch +Node-kind: dir +Node-action: add +Prop-content-length: 10 +Content-length: 10 + +PROPS-END + + +Revision-number: 10 +Prop-content-length: 70 +Content-length: 70 + +K 10 +svn:author +V 7 +jrandom +K 7 +svn:log +V 14 +Nominate r4+r9 +PROPS-END + +Node-path: branch/STATUS +Node-kind: file +Node-action: change +Text-content-md5: 608287647ed261a4e96f6eb9aec989d5 +Text-content-sha1: b790dd7d918d01cebdfbb3c055d8f10d4252f0ae +Text-content-length: 260 +Content-length: 260 + +Status of 1.8.x: + +Candidate changes: +================== + +Random new subheading: +====================== + +Veto-blocked changes: +===================== + +Approved changes: +================= + + * r4, r9 + default logsummary + Branch: r4 + Votes: + +1: jrandom + + + +Revision-number: 11 +Prop-content-length: 150 +Content-length: 150 + +K 10 +svn:author +V 6 +daniel +K 7 +svn:log +V 95 +Merge the r4 branch: + + * r4, r9 + default logsummary + Branch: r4 + Votes: + +1: jrandom + +PROPS-END + +Node-path: branch +Node-kind: dir +Node-action: change +Prop-content-length: 83 +Content-length: 83 + +K 13 +svn:mergeinfo +V 48 +/subversion/branches/r4:7-10 +/subversion/trunk:4 +PROPS-END + + +Node-path: branch/A_resolved +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 10 +Node-copyfrom-path: subversion/branches/r4/A_resolved + + +Node-path: branch/STATUS +Node-kind: file +Node-action: change +Text-content-md5: 6f71fec92afeaa5c1ebe02349f548ca9 +Text-content-sha1: eece02003d9c51610249e3fdd0d4e191e02ba3b7 +Text-content-length: 185 +Content-length: 185 + +Status of 1.8.x: + +Candidate changes: +================== + +Random new subheading: +====================== + +Veto-blocked changes: +===================== + +Approved changes: +================= + + +Node-path: branch/dir-created-on-backport-branch +Node-kind: dir +Node-action: add +Node-copyfrom-rev: 10 +Node-copyfrom-path: subversion/branches/r4/dir-created-on-backport-branch + + +Node-path: branch/iota +Node-kind: file +Node-action: change +Text-content-md5: 1d0413d4da6866dae63f902165786614 +Text-content-sha1: e2cb0815ec8f0a8b36c6aa910c1f894ec1487da3 +Text-content-length: 9 +Content-length: 9 + +resolved + + +Revision-number: 12 +Prop-content-length: 93 +Content-length: 93 + +K 10 +svn:author +V 6 +daniel +K 7 +svn:log +V 38 +Remove the 'r4' branch, merged in r11. +PROPS-END + +Node-path: subversion/branches/r4 +Node-action: delete + + diff --git a/tools/dist/backport_tests.py b/tools/dist/backport_tests.py index e2b486286062d..3b0c6577f30ba 100755 --- a/tools/dist/backport_tests.py +++ b/tools/dist/backport_tests.py @@ -551,6 +551,44 @@ def backport_double_conflict(sbox): +#---------------------------------------------------------------------- +@BackportTest('76cee987-25c9-4d6c-ad40-000000000009') +def backport_branch_with_original_revision(sbox): + "branch with original revision" + + # r6: conflicting change on branch + sbox.simple_append('branch/iota', 'Conflicts with first change') + sbox.simple_commit(message="Conflicting change on iota") + + # r7: backport branch + sbox.simple_update() + sbox.simple_copy('branch', 'subversion/branches/r4') + sbox.simple_commit(message='Create a backport branch') + + # r8: merge into backport branch + sbox.simple_update() + svntest.main.run_svn(None, 'merge', '--record-only', '-c4', + '^/subversion/trunk', sbox.ospath('subversion/branches/r4')) + sbox.simple_mkdir('subversion/branches/r4/A_resolved') + sbox.simple_append('subversion/branches/r4/iota', "resolved\n", truncate=1) + sbox.simple_commit(message='Conflict resolution via mkdir') + + # r9: original revision on branch + sbox.simple_update() + sbox.simple_mkdir('subversion/branches/r4/dir-created-on-backport-branch') + sbox.simple_commit(message='An original revision on the backport branch') + + # r10: nominate the branch with r9 listed + approved_entries = [ + make_entry([4, 9], branch="r4") + ] + sbox.simple_append(STATUS, serialize_STATUS(approved_entries)) + sbox.simple_commit(message='Nominate r4+r9') + + # r11, r12: Run it. + run_backport(sbox) + + #---------------------------------------------------------------------- ######################################################################## @@ -566,6 +604,7 @@ def backport_double_conflict(sbox): backport_conflicts_detection, backport_branch_contains, backport_double_conflict, + backport_branch_with_original_revision, # When adding a new test, include the test number in the last # 6 bytes of the UUID. ]