mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
pull: add source information to the transaction
The source information can, should be applied once when opening the transaction for the pull. This will lets element processed within a bundle2 be aware of them and open the door to running a set of hooks when closing this pull transaction. This is similar to what is done in server's unbundle call.
This commit is contained in:
parent
03cb1a74e8
commit
830b7b0082
@ -827,6 +827,8 @@ class pulloperation(object):
|
|||||||
"""get appropriate pull transaction, creating it if needed"""
|
"""get appropriate pull transaction, creating it if needed"""
|
||||||
if self._tr is None:
|
if self._tr is None:
|
||||||
self._tr = self.repo.transaction(self._trname)
|
self._tr = self.repo.transaction(self._trname)
|
||||||
|
self._tr.hookargs['source'] = 'pull'
|
||||||
|
self._tr.hookargs['url'] = self.remote.url()
|
||||||
return self._tr
|
return self._tr
|
||||||
|
|
||||||
def closetransaction(self):
|
def closetransaction(self):
|
||||||
|
@ -59,7 +59,7 @@ clone --pull
|
|||||||
adding file changes
|
adding file changes
|
||||||
added 2 changesets with 2 changes to 2 files
|
added 2 changesets with 2 changes to 2 files
|
||||||
1 new obsolescence markers
|
1 new obsolescence markers
|
||||||
changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
|
||||||
updating to branch default
|
updating to branch default
|
||||||
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||||
$ hg -R other log -G
|
$ hg -R other log -G
|
||||||
@ -81,7 +81,7 @@ pull
|
|||||||
adding file changes
|
adding file changes
|
||||||
added 1 changesets with 1 changes to 1 files (+1 heads)
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
||||||
1 new obsolescence markers
|
1 new obsolescence markers
|
||||||
changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_SOURCE=pull HG_URL=file:$TESTTMP/main
|
||||||
(run 'hg heads' to see heads, 'hg merge' to merge)
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
||||||
$ hg -R other log -G
|
$ hg -R other log -G
|
||||||
o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
|
o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
|
||||||
@ -185,7 +185,7 @@ pull over ssh
|
|||||||
added 1 changesets with 1 changes to 1 files (+1 heads)
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
||||||
1 new obsolescence markers
|
1 new obsolescence markers
|
||||||
updating bookmark book_02de
|
updating bookmark book_02de
|
||||||
changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_SOURCE=pull HG_URL=ssh://user@dummy/main
|
||||||
(run 'hg heads' to see heads, 'hg merge' to merge)
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
||||||
$ hg -R other debugobsolete
|
$ hg -R other debugobsolete
|
||||||
1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
|
1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
|
||||||
@ -207,7 +207,7 @@ pull over http
|
|||||||
added 1 changesets with 1 changes to 1 files (+1 heads)
|
added 1 changesets with 1 changes to 1 files (+1 heads)
|
||||||
1 new obsolescence markers
|
1 new obsolescence markers
|
||||||
updating bookmark book_42cc
|
updating bookmark book_42cc
|
||||||
changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_SOURCE=pull HG_URL=http://localhost:$HGPORT/
|
||||||
(run 'hg heads .' to see heads, 'hg merge' to merge)
|
(run 'hg heads .' to see heads, 'hg merge' to merge)
|
||||||
$ cat main-error.log
|
$ cat main-error.log
|
||||||
$ hg -R other debugobsolete
|
$ hg -R other debugobsolete
|
||||||
|
@ -82,17 +82,17 @@ Pull the new commits in the clone
|
|||||||
adding manifests
|
adding manifests
|
||||||
adding file changes
|
adding file changes
|
||||||
added 1 changesets with 1 changes to 1 files
|
added 1 changesets with 1 changes to 1 files
|
||||||
pretxnchangegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=bundle2 HG_URL=bundle2
|
pretxnchangegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
remote: changegroup2
|
remote: changegroup2
|
||||||
adding changesets
|
adding changesets
|
||||||
adding manifests
|
adding manifests
|
||||||
adding file changes
|
adding file changes
|
||||||
added 1 changesets with 1 changes to 1 files
|
added 1 changesets with 1 changes to 1 files
|
||||||
pretxnchangegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
pretxnchangegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
changegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=27547f69f25460a52fff66ad004e58da7ad3fb56 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
changegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=f838bfaca5c7226600ebcfd84f3c3c13a28d3757 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
pullop.cgresult is 1
|
pullop.cgresult is 1
|
||||||
(run 'hg update' to get a working copy)
|
(run 'hg update' to get a working copy)
|
||||||
$ hg update
|
$ hg update
|
||||||
@ -152,20 +152,20 @@ pullop.cgresult
|
|||||||
adding manifests
|
adding manifests
|
||||||
adding file changes
|
adding file changes
|
||||||
added 2 changesets with 2 changes to 2 files (+1 heads)
|
added 2 changesets with 2 changes to 2 files (+1 heads)
|
||||||
pretxnchangegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_PENDING=$TESTTMP/clone HG_SOURCE=bundle2 HG_URL=bundle2
|
pretxnchangegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
remote: changegroup2
|
remote: changegroup2
|
||||||
adding changesets
|
adding changesets
|
||||||
adding manifests
|
adding manifests
|
||||||
adding file changes
|
adding file changes
|
||||||
added 3 changesets with 3 changes to 3 files (+1 heads)
|
added 3 changesets with 3 changes to 3 files (+1 heads)
|
||||||
pretxnchangegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
pretxnchangegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
changegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=b3325c91a4d916bcc4cdc83ea3fe4ece46a42f6e HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=8a5212ebc8527f9fb821601504794e3eb11a1ed3 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
changegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=7f219660301fe4c8a116f714df5e769695cc2b46 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=1d14c3ce6ac0582d2809220d33e8cd7a696e0156 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=5cd59d311f6508b8e0ed28a266756c859419c9f1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
pullop.cgresult is 3
|
pullop.cgresult is 3
|
||||||
(run 'hg heads' to see heads, 'hg merge' to merge)
|
(run 'hg heads' to see heads, 'hg merge' to merge)
|
||||||
$ hg log -G
|
$ hg log -G
|
||||||
@ -225,17 +225,17 @@ pullop.cgresult
|
|||||||
adding manifests
|
adding manifests
|
||||||
adding file changes
|
adding file changes
|
||||||
added 1 changesets with 0 changes to 0 files (-1 heads)
|
added 1 changesets with 0 changes to 0 files (-1 heads)
|
||||||
pretxnchangegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=bundle2 HG_URL=bundle2
|
pretxnchangegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_PENDING=$TESTTMP/clone HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
remote: changegroup2
|
remote: changegroup2
|
||||||
adding changesets
|
adding changesets
|
||||||
adding manifests
|
adding manifests
|
||||||
adding file changes
|
adding file changes
|
||||||
added 1 changesets with 1 changes to 1 files
|
added 1 changesets with 1 changes to 1 files
|
||||||
pretxnchangegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
pretxnchangegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PENDING=$TESTTMP/clone HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
changegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=71bd7b46de72e69a32455bf88d04757d542e6cf4 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
changegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
changegroup hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
incoming hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=bundle2 HG_URL=bundle2
|
incoming hook: HG_NODE=9d18e5bd9ab09337802595d49f1dad0c98df4d84 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_URL=file:$TESTTMP/repo
|
||||||
pullop.cgresult is -2
|
pullop.cgresult is -2
|
||||||
(run 'hg update' to get a working copy)
|
(run 'hg update' to get a working copy)
|
||||||
$ hg log -G
|
$ hg log -G
|
||||||
|
Loading…
Reference in New Issue
Block a user