##// END OF EJS Templates
changegroup: use a copy of hookargs when invoking the changegroup hook...
Mike Hommey -
r22960:7c13c940 default
parent child Browse files
Show More
@@ -687,8 +687,12 b' def addchangegroup(repo, source, srctype'
687 p = lambda: cl.writepending() and repo.root or ""
687 p = lambda: cl.writepending() and repo.root or ""
688 if 'node' not in tr.hookargs:
688 if 'node' not in tr.hookargs:
689 tr.hookargs['node'] = hex(cl.node(clstart))
689 tr.hookargs['node'] = hex(cl.node(clstart))
690 hookargs = dict(tr.hookargs)
691 else:
692 hookargs = dict(tr.hookargs)
693 hookargs['node'] = hex(cl.node(clstart))
690 repo.hook('pretxnchangegroup', throw=True, source=srctype,
694 repo.hook('pretxnchangegroup', throw=True, source=srctype,
691 url=url, pending=p, **tr.hookargs)
695 url=url, pending=p, **hookargs)
692
696
693 added = [cl.node(r) for r in xrange(clstart, clend)]
697 added = [cl.node(r) for r in xrange(clstart, clend)]
694 publishing = repo.ui.configbool('phases', 'publish', True)
698 publishing = repo.ui.configbool('phases', 'publish', True)
@@ -724,6 +728,7 b' def addchangegroup(repo, source, srctype'
724 # `destroyed` will repair it.
728 # `destroyed` will repair it.
725 # In other case we can safely update cache on disk.
729 # In other case we can safely update cache on disk.
726 branchmap.updatecache(repo.filtered('served'))
730 branchmap.updatecache(repo.filtered('served'))
731
727 def runhooks():
732 def runhooks():
728 # These hooks run when the lock releases, not when the
733 # These hooks run when the lock releases, not when the
729 # transaction closes. So it's possible for the changelog
734 # transaction closes. So it's possible for the changelog
@@ -734,7 +739,7 b' def addchangegroup(repo, source, srctype'
734 # forcefully update the on-disk branch cache
739 # forcefully update the on-disk branch cache
735 repo.ui.debug("updating the branch cache\n")
740 repo.ui.debug("updating the branch cache\n")
736 repo.hook("changegroup", source=srctype, url=url,
741 repo.hook("changegroup", source=srctype, url=url,
737 **tr.hookargs)
742 **hookargs)
738
743
739 for n in added:
744 for n in added:
740 repo.hook("incoming", node=hex(n), source=srctype,
745 repo.hook("incoming", node=hex(n), source=srctype,
@@ -224,7 +224,7 b' hg -R bundle://../full.hg verify'
224 adding manifests
224 adding manifests
225 adding file changes
225 adding file changes
226 added 9 changesets with 7 changes to 4 files (+1 heads)
226 added 9 changesets with 7 changes to 4 files (+1 heads)
227 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=bundle:../full.hg
227 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:../full.hg
228 (run 'hg heads' to see heads, 'hg merge' to merge)
228 (run 'hg heads' to see heads, 'hg merge' to merge)
229
229
230 Rollback empty
230 Rollback empty
@@ -247,7 +247,7 b' Pull full.hg into empty again (using -R;'
247 adding manifests
247 adding manifests
248 adding file changes
248 adding file changes
249 added 9 changesets with 7 changes to 4 files (+1 heads)
249 added 9 changesets with 7 changes to 4 files (+1 heads)
250 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
250 changegroup hook: HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_SOURCE=pull HG_URL=bundle:empty+full.hg
251 (run 'hg heads' to see heads, 'hg merge' to merge)
251 (run 'hg heads' to see heads, 'hg merge' to merge)
252
252
253 Create partial clones
253 Create partial clones
@@ -37,7 +37,7 b' The extension requires a repo (currently'
37 adding manifests
37 adding manifests
38 adding file changes
38 adding file changes
39 added 8 changesets with 7 changes to 7 files (+3 heads)
39 added 8 changesets with 7 changes to 7 files (+3 heads)
40 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_URL=bundle:/home/pyd/src/mercurial-dev/tests/bundles/rebase.hg
40 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=unbundle HG_URL=bundle:*/rebase.hg (glob)
41 (run 'hg heads' to see heads, 'hg merge' to merge)
41 (run 'hg heads' to see heads, 'hg merge' to merge)
42
42
43 $ cd ..
43 $ cd ..
@@ -59,7 +59,7 b' clone --pull'
59 adding file changes
59 adding file changes
60 added 2 changesets with 2 changes to 2 files
60 added 2 changesets with 2 changes to 2 files
61 1 new obsolescence markers
61 1 new obsolescence markers
62 changegroup hook: HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
62 changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=bundle2 HG_URL=bundle2
63 updating to branch default
63 updating to branch default
64 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
65 $ hg -R other log -G
65 $ hg -R other log -G
@@ -81,7 +81,7 b' pull'
81 adding file changes
81 adding file changes
82 added 1 changesets with 1 changes to 1 files (+1 heads)
82 added 1 changesets with 1 changes to 1 files (+1 heads)
83 1 new obsolescence markers
83 1 new obsolescence markers
84 changegroup hook: HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
84 changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=bundle2 HG_URL=bundle2
85 (run 'hg heads' to see heads, 'hg merge' to merge)
85 (run 'hg heads' to see heads, 'hg merge' to merge)
86 $ hg -R other log -G
86 $ hg -R other log -G
87 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
87 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
@@ -153,7 +153,7 b' push'
153 pushing to other
153 pushing to other
154 searching for changes
154 searching for changes
155 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_URL=push
155 b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_URL=push
156 changegroup hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
156 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_SOURCE=bundle2 HG_URL=bundle2
157 remote: adding changesets
157 remote: adding changesets
158 remote: adding manifests
158 remote: adding manifests
159 remote: adding file changes
159 remote: adding file changes
@@ -185,7 +185,7 b' pull over ssh'
185 added 1 changesets with 1 changes to 1 files (+1 heads)
185 added 1 changesets with 1 changes to 1 files (+1 heads)
186 1 new obsolescence markers
186 1 new obsolescence markers
187 updating bookmark book_02de
187 updating bookmark book_02de
188 changegroup hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
188 changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=bundle2 HG_URL=bundle2
189 (run 'hg heads' to see heads, 'hg merge' to merge)
189 (run 'hg heads' to see heads, 'hg merge' to merge)
190 $ hg -R other debugobsolete
190 $ hg -R other debugobsolete
191 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
191 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
@@ -207,7 +207,7 b' pull over http'
207 added 1 changesets with 1 changes to 1 files (+1 heads)
207 added 1 changesets with 1 changes to 1 files (+1 heads)
208 1 new obsolescence markers
208 1 new obsolescence markers
209 updating bookmark book_42cc
209 updating bookmark book_42cc
210 changegroup hook: HG_BOOKMARK_MOVED=1 HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
210 changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=bundle2 HG_URL=bundle2
211 (run 'hg heads .' to see heads, 'hg merge' to merge)
211 (run 'hg heads .' to see heads, 'hg merge' to merge)
212 $ cat main-error.log
212 $ cat main-error.log
213 $ hg -R other debugobsolete
213 $ hg -R other debugobsolete
@@ -229,7 +229,7 b' push over ssh'
229 remote: 1 new obsolescence markers
229 remote: 1 new obsolescence markers
230 updating bookmark book_5fdd
230 updating bookmark book_5fdd
231 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
231 remote: b2x-transactionclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
232 remote: changegroup hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=bundle2 HG_URL=bundle2
232 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=bundle2 HG_URL=bundle2
233 $ hg -R other log -G
233 $ hg -R other log -G
234 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
234 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
235 |
235 |
@@ -456,7 +456,7 b' Doing the actual push: hook abort'
456 searching for changes
456 searching for changes
457 transaction abort!
457 transaction abort!
458 rollback completed
458 rollback completed
459 changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=bundle2 HG_URL=bundle2
459 changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=bundle2 HG_URL=bundle2
460 abort: b2x-pretransactionclose.failpush hook exited with status 1
460 abort: b2x-pretransactionclose.failpush hook exited with status 1
461 [255]
461 [255]
462
462
@@ -466,7 +466,7 b' Doing the actual push: hook abort'
466 abort: b2x-pretransactionclose.failpush hook exited with status 1
466 abort: b2x-pretransactionclose.failpush hook exited with status 1
467 remote: transaction abort!
467 remote: transaction abort!
468 remote: rollback completed
468 remote: rollback completed
469 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NEW_OBSMARKERS=0 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=bundle2 HG_URL=bundle2
469 remote: changegroup hook: HG_BUNDLE2-EXP=1 HG_NODE=e7ec4e813ba6b07be2a0516ce1a74bb4e503f91a HG_SOURCE=bundle2 HG_URL=bundle2
470 [255]
470 [255]
471
471
472 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
472 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
@@ -87,7 +87,7 b' test generic hooks'
87 adding manifests
87 adding manifests
88 adding file changes
88 adding file changes
89 added 3 changesets with 2 changes to 2 files
89 added 3 changesets with 2 changes to 2 files
90 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
90 changegroup hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
91 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
91 incoming hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_URL=file:$TESTTMP/a
92 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
92 incoming hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
93 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
93 incoming hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_URL=file:$TESTTMP/a
@@ -125,7 +125,7 b' pull'
125 adding manifests
125 adding manifests
126 adding file changes
126 adding file changes
127 added 1 changesets with 1 changes to 1 files
127 added 1 changesets with 1 changes to 1 files
128 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/
128 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=http://localhost:$HGPORT1/
129 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
130 $ cd ..
130 $ cd ..
131
131
@@ -162,7 +162,7 b' pull without cacert'
162 adding manifests
162 adding manifests
163 adding file changes
163 adding file changes
164 added 1 changesets with 1 changes to 1 files
164 added 1 changesets with 1 changes to 1 files
165 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
165 changegroup hook: HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d HG_SOURCE=pull HG_URL=https://localhost:$HGPORT/
166 (run 'hg update' to get a working copy)
166 (run 'hg update' to get a working copy)
167 $ cd ..
167 $ cd ..
168
168
@@ -67,7 +67,7 b' expect success'
67 remote: adding manifests
67 remote: adding manifests
68 remote: adding file changes
68 remote: adding file changes
69 remote: added 1 changesets with 1 changes to 1 files
69 remote: added 1 changesets with 1 changes to 1 files
70 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_PHASES_MOVED=1 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
70 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
71 % serve errors
71 % serve errors
72 $ hg rollback
72 $ hg rollback
73 repository tip rolled back to revision 0 (undo serve)
73 repository tip rolled back to revision 0 (undo serve)
@@ -83,7 +83,7 b' expect success, server lacks the httphea'
83 remote: adding manifests
83 remote: adding manifests
84 remote: adding file changes
84 remote: adding file changes
85 remote: added 1 changesets with 1 changes to 1 files
85 remote: added 1 changesets with 1 changes to 1 files
86 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_PHASES_MOVED=1 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
86 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
87 % serve errors
87 % serve errors
88 $ hg rollback
88 $ hg rollback
89 repository tip rolled back to revision 0 (undo serve)
89 repository tip rolled back to revision 0 (undo serve)
@@ -99,7 +99,7 b' expect success, server lacks the unbundl'
99 remote: adding manifests
99 remote: adding manifests
100 remote: adding file changes
100 remote: adding file changes
101 remote: added 1 changesets with 1 changes to 1 files
101 remote: added 1 changesets with 1 changes to 1 files
102 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_PHASES_MOVED=1 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
102 remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_URL=remote:http:127.0.0.1:
103 % serve errors
103 % serve errors
104 $ hg rollback
104 $ hg rollback
105 repository tip rolled back to revision 0 (undo serve)
105 repository tip rolled back to revision 0 (undo serve)
@@ -410,7 +410,7 b' stderr from remote commands should be pr'
410 Got arguments 1:user@dummy 2:hg -R local serve --stdio
410 Got arguments 1:user@dummy 2:hg -R local serve --stdio
411 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
411 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
412 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
412 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
413 changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_PHASES_MOVED=1 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
413 changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_URL=remote:ssh:127.0.0.1
414 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
414 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
415 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
415 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
416 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
416 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -68,7 +68,7 b' check for HTTP opener failures when cach'
68 adding manifests
68 adding manifests
69 adding file changes
69 adding file changes
70 added 1 changesets with 1 changes to 1 files
70 added 1 changesets with 1 changes to 1 files
71 changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
71 changegroup hook: HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/remote
72 (run 'hg update' to get a working copy)
72 (run 'hg update' to get a working copy)
73
73
74 trying to push
74 trying to push
General Comments 0
You need to be logged in to leave comments. Login now