Show More
@@ -106,8 +106,18 b' class shelvedfile(object):' | |||||
106 | return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root, |
|
106 | return bundlerepo.bundlerepository(self.repo.baseui, self.repo.root, | |
107 | self.vfs.join(self.fname)) |
|
107 | self.vfs.join(self.fname)) | |
108 | def writebundle(self, bases, node): |
|
108 | def writebundle(self, bases, node): | |
109 | cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve') |
|
109 | btype = 'HG10BZ' | |
110 | changegroup.writebundle(self.ui, cg, self.fname, 'HG10BZ', self.vfs) |
|
110 | cgversion = '01' | |
|
111 | compression = None | |||
|
112 | if 'generaldelta' in self.repo.requirements: | |||
|
113 | btype = 'HG20' | |||
|
114 | cgversion = '02' | |||
|
115 | compression = 'BZ' | |||
|
116 | ||||
|
117 | cg = changegroup.changegroupsubset(self.repo, bases, [node], 'shelve', | |||
|
118 | version=cgversion) | |||
|
119 | changegroup.writebundle(self.ui, cg, self.fname, btype, self.vfs, | |||
|
120 | compression=compression) | |||
111 |
|
121 | |||
112 | class shelvedstate(object): |
|
122 | class shelvedstate(object): | |
113 | """Handle persistence during unshelving operations. |
|
123 | """Handle persistence during unshelving operations. |
@@ -954,3 +954,49 b' shelve --patch and shelve --stat should ' | |||||
954 | abort: cannot find shelf nonexistentshelf |
|
954 | abort: cannot find shelf nonexistentshelf | |
955 | [255] |
|
955 | [255] | |
956 |
|
956 | |||
|
957 | $ cd .. | |||
|
958 | ||||
|
959 | Shelve from general delta repo uses bundle2 on disk | |||
|
960 | -------------------------------------------------- | |||
|
961 | ||||
|
962 | no general delta | |||
|
963 | ||||
|
964 | $ hg clone --pull repo bundle1 --config format.generaldelta=0 | |||
|
965 | requesting all changes | |||
|
966 | adding changesets | |||
|
967 | adding manifests | |||
|
968 | adding file changes | |||
|
969 | added 5 changesets with 8 changes to 6 files | |||
|
970 | updating to branch default | |||
|
971 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
972 | $ cd bundle1 | |||
|
973 | $ echo babar > jungle | |||
|
974 | $ hg add jungle | |||
|
975 | $ hg shelve | |||
|
976 | shelved as default | |||
|
977 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
978 | $ hg debugbundle .hg/shelved/*.hg | |||
|
979 | 7e30d8ac6f23cfc84330fd7e698730374615d21a | |||
|
980 | $ cd .. | |||
|
981 | ||||
|
982 | with general delta | |||
|
983 | ||||
|
984 | $ hg clone --pull repo bundle2 --config format.generaldelta=1 | |||
|
985 | requesting all changes | |||
|
986 | adding changesets | |||
|
987 | adding manifests | |||
|
988 | adding file changes | |||
|
989 | added 5 changesets with 8 changes to 6 files | |||
|
990 | updating to branch default | |||
|
991 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
992 | $ cd bundle2 | |||
|
993 | $ echo babar > jungle | |||
|
994 | $ hg add jungle | |||
|
995 | $ hg shelve | |||
|
996 | shelved as default | |||
|
997 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
998 | $ hg debugbundle .hg/shelved/*.hg | |||
|
999 | Stream params: {'Compression': 'BZ'} | |||
|
1000 | changegroup -- "{'version': '02'}" | |||
|
1001 | 7e30d8ac6f23cfc84330fd7e698730374615d21a | |||
|
1002 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now