--- a/mercurial/exchange.py Wed May 27 22:25:33 2015 -0700
+++ b/mercurial/exchange.py Wed May 27 22:25:51 2015 -0700
@@ -524,14 +524,23 @@
return
pushop.stepsdone.add('phases')
part2node = []
+
+ def handlefailure(pushop, exc):
+ targetid = int(exc.partid)
+ for partid, node in part2node:
+ if partid == targetid:
+ raise error.Abort(_('updating %s to public failed') % node)
+
enc = pushkey.encode
for newremotehead in pushop.outdatedphases:
- part = bundler.newpart('pushkey', mandatory=False)
+ part = bundler.newpart('pushkey')
part.addparam('namespace', enc('phases'))
part.addparam('key', enc(newremotehead.hex()))
part.addparam('old', enc(str(phases.draft)))
part.addparam('new', enc(str(phases.public)))
part2node.append((part.id, newremotehead))
+ pushop.pkfailcb[part.id] = handlefailure
+
def handlereply(op):
for partid, node in part2node:
partrep = op.records.getreplies(partid)
--- a/tests/test-acl.t Wed May 27 22:25:33 2015 -0700
+++ b/tests/test-acl.t Wed May 27 22:25:51 2015 -0700
@@ -102,7 +102,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -120,7 +120,7 @@
adding quux/file.py revisions
added 3 changesets with 3 changes to 3 files
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -166,7 +166,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -186,7 +186,7 @@
calling hook pretxnchangegroup.acl: hgext.acl.hook
acl: changes have source "push" - skipping
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -233,7 +233,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -263,7 +263,7 @@
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -310,7 +310,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -375,7 +375,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -445,7 +445,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -512,7 +512,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -584,7 +584,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -653,7 +653,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -724,7 +724,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -754,7 +754,7 @@
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -808,7 +808,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -886,7 +886,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -959,7 +959,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1043,7 +1043,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1073,7 +1073,7 @@
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -1130,7 +1130,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1160,7 +1160,7 @@
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -1213,7 +1213,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1289,7 +1289,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1320,7 +1320,7 @@
acl: branch access granted: "911600dab2ae" on branch "default"
acl: path access granted: "911600dab2ae"
bundle2-input-part: total payload size 1606
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
bundle2-input-bundle: 3 parts total
updating the branch cache
@@ -1373,7 +1373,7 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1488,8 +1488,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1523,9 +1523,9 @@
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
bundle2-input-part: total payload size 2101
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
updating the branch cache
@@ -1577,8 +1577,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1651,8 +1651,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1721,8 +1721,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1785,8 +1785,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1820,9 +1820,9 @@
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
bundle2-input-part: total payload size 2101
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
updating the branch cache
@@ -1879,8 +1879,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -1914,9 +1914,9 @@
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
bundle2-input-part: total payload size 2101
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
updating the branch cache
@@ -1972,8 +1972,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -2041,8 +2041,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155
@@ -2076,9 +2076,9 @@
acl: branch access granted: "e8fc755d4d82" on branch "foobar"
acl: path access granted: "e8fc755d4d82"
bundle2-input-part: total payload size 2101
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:911600dab2ae7a9baff75958b84fe606851ce955"
- bundle2-input-part: "pushkey" (advisory) (params: 4 mandatory) supported
+ bundle2-input-part: "pushkey" (params: 4 mandatory) supported
pushing key for "phases:e8fc755d4d8217ee5b0c2bb41558c40d43b92c01"
bundle2-input-bundle: 4 parts total
updating the branch cache
@@ -2128,8 +2128,8 @@
bundle2-output-part: "replycaps" 155 bytes payload
bundle2-output-part: "check:heads" streamed payload
bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
- bundle2-output-part: "pushkey" (advisory) (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
+ bundle2-output-part: "pushkey" (params: 4 mandatory) empty payload
bundle2-input-bundle: with-transaction
bundle2-input-part: "replycaps" supported
bundle2-input-part: total payload size 155