##// END OF EJS Templates
localrepo: add unbundle support...
Pierre-Yves David -
r20969:7a679918 default
parent child Browse files
Show More
@@ -643,14 +643,7 b' def unbundle(repo, cg, heads, source, ur'
643 try:
643 try:
644 check_heads(repo, heads, 'uploading changes')
644 check_heads(repo, heads, 'uploading changes')
645 # push can proceed
645 # push can proceed
646 try:
646 r = changegroup.addchangegroup(repo, cg, source, url)
647 r = changegroup.addchangegroup(repo, cg, source, url)
648 except util.Abort, inst:
649 # The old code we moved used sys.stderr directly.
650 # We did not changed it to minise code change.
651 # This need to be moved to something proper.
652 # Feel free to do it.
653 sys.stderr.write("abort: %s\n" % inst)
654 finally:
647 finally:
655 lock.release()
648 lock.release()
656 return r
649 return r
@@ -63,7 +63,7 b' def unfilteredmethod(orig):'
63 return wrapper
63 return wrapper
64
64
65 moderncaps = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle',
65 moderncaps = set(('lookup', 'branchmap', 'pushkey', 'known', 'getbundle',
66 'bundle2'))
66 'bundle2', 'unbundle'))
67 legacycaps = moderncaps.union(set(['changegroupsubset']))
67 legacycaps = moderncaps.union(set(['changegroupsubset']))
68
68
69 class localpeer(peer.peerrepository):
69 class localpeer(peer.peerrepository):
@@ -112,6 +112,15 b' class localpeer(peer.peerrepository):'
112 # TODO We might want to move the next two calls into legacypeer and add
112 # TODO We might want to move the next two calls into legacypeer and add
113 # unbundle instead.
113 # unbundle instead.
114
114
115 def unbundle(self, cg, heads, url):
116 """apply a bundle on a repo
117
118 This function handles the repo locking itself."""
119 try:
120 return exchange.unbundle(self._repo, cg, heads, 'push', url)
121 except exchange.PushRaced, exc:
122 raise error.ResponseError(_('push failed:'), exc.message)
123
115 def lock(self):
124 def lock(self):
116 return self._repo.lock()
125 return self._repo.lock()
117
126
@@ -774,5 +774,12 b' def unbundle(repo, proto, heads):'
774 finally:
774 finally:
775 fp.close()
775 fp.close()
776 os.unlink(tempname)
776 os.unlink(tempname)
777 except util.Abort, inst:
778 # The old code we moved used sys.stderr directly.
779 # We did not changed it to minise code change.
780 # This need to be moved to something proper.
781 # Feel free to do it.
782 sys.stderr.write("abort: %s\n" % inst)
783 return pushres(0)
777 except exchange.PushRaced, exc:
784 except exchange.PushRaced, exc:
778 return pusherr(str(exc))
785 return pusherr(str(exc))
@@ -116,9 +116,9 b' Extension disabled for lack of a hook'
116 adding quux/file.py revisions
116 adding quux/file.py revisions
117 files: 3/3 chunks (100.00%)
117 files: 3/3 chunks (100.00%)
118 added 3 changesets with 3 changes to 3 files
118 added 3 changesets with 3 changes to 3 files
119 updating the branch cache
119 listing keys for "phases"
120 listing keys for "phases"
120 try to push obsolete markers to remote
121 try to push obsolete markers to remote
121 updating the branch cache
122 checking for updated bookmarks
122 checking for updated bookmarks
123 listing keys for "bookmarks"
123 listing keys for "bookmarks"
124 repository tip rolled back to revision 0 (undo push)
124 repository tip rolled back to revision 0 (undo push)
@@ -177,9 +177,9 b' Extension disabled for lack of acl.sourc'
177 added 3 changesets with 3 changes to 3 files
177 added 3 changesets with 3 changes to 3 files
178 calling hook pretxnchangegroup.acl: hgext.acl.hook
178 calling hook pretxnchangegroup.acl: hgext.acl.hook
179 acl: changes have source "push" - skipping
179 acl: changes have source "push" - skipping
180 updating the branch cache
180 listing keys for "phases"
181 listing keys for "phases"
181 try to push obsolete markers to remote
182 try to push obsolete markers to remote
182 updating the branch cache
183 checking for updated bookmarks
183 checking for updated bookmarks
184 listing keys for "bookmarks"
184 listing keys for "bookmarks"
185 repository tip rolled back to revision 0 (undo push)
185 repository tip rolled back to revision 0 (undo push)
@@ -249,9 +249,9 b' No [acl.allow]/[acl.deny]'
249 acl: path access granted: "f9cafe1212c8"
249 acl: path access granted: "f9cafe1212c8"
250 acl: branch access granted: "911600dab2ae" on branch "default"
250 acl: branch access granted: "911600dab2ae" on branch "default"
251 acl: path access granted: "911600dab2ae"
251 acl: path access granted: "911600dab2ae"
252 updating the branch cache
252 listing keys for "phases"
253 listing keys for "phases"
253 try to push obsolete markers to remote
254 try to push obsolete markers to remote
254 updating the branch cache
255 checking for updated bookmarks
255 checking for updated bookmarks
256 listing keys for "bookmarks"
256 listing keys for "bookmarks"
257 repository tip rolled back to revision 0 (undo push)
257 repository tip rolled back to revision 0 (undo push)
@@ -747,9 +747,9 b' barney is allowed everywhere'
747 acl: path access granted: "f9cafe1212c8"
747 acl: path access granted: "f9cafe1212c8"
748 acl: branch access granted: "911600dab2ae" on branch "default"
748 acl: branch access granted: "911600dab2ae" on branch "default"
749 acl: path access granted: "911600dab2ae"
749 acl: path access granted: "911600dab2ae"
750 updating the branch cache
750 listing keys for "phases"
751 listing keys for "phases"
751 try to push obsolete markers to remote
752 try to push obsolete markers to remote
752 updating the branch cache
753 checking for updated bookmarks
753 checking for updated bookmarks
754 listing keys for "bookmarks"
754 listing keys for "bookmarks"
755 repository tip rolled back to revision 0 (undo push)
755 repository tip rolled back to revision 0 (undo push)
@@ -1067,9 +1067,9 b' acl.config can set only [acl.allow]/[acl'
1067 acl: path access granted: "f9cafe1212c8"
1067 acl: path access granted: "f9cafe1212c8"
1068 acl: branch access granted: "911600dab2ae" on branch "default"
1068 acl: branch access granted: "911600dab2ae" on branch "default"
1069 acl: path access granted: "911600dab2ae"
1069 acl: path access granted: "911600dab2ae"
1070 updating the branch cache
1070 listing keys for "phases"
1071 listing keys for "phases"
1071 try to push obsolete markers to remote
1072 try to push obsolete markers to remote
1072 updating the branch cache
1073 checking for updated bookmarks
1073 checking for updated bookmarks
1074 listing keys for "bookmarks"
1074 listing keys for "bookmarks"
1075 repository tip rolled back to revision 0 (undo push)
1075 repository tip rolled back to revision 0 (undo push)
@@ -1147,9 +1147,9 b' fred is always allowed'
1147 acl: path access granted: "f9cafe1212c8"
1147 acl: path access granted: "f9cafe1212c8"
1148 acl: branch access granted: "911600dab2ae" on branch "default"
1148 acl: branch access granted: "911600dab2ae" on branch "default"
1149 acl: path access granted: "911600dab2ae"
1149 acl: path access granted: "911600dab2ae"
1150 updating the branch cache
1150 listing keys for "phases"
1151 listing keys for "phases"
1151 try to push obsolete markers to remote
1152 try to push obsolete markers to remote
1152 updating the branch cache
1153 checking for updated bookmarks
1153 checking for updated bookmarks
1154 listing keys for "bookmarks"
1154 listing keys for "bookmarks"
1155 repository tip rolled back to revision 0 (undo push)
1155 repository tip rolled back to revision 0 (undo push)
@@ -1300,9 +1300,9 b' OS-level groups'
1300 acl: path access granted: "f9cafe1212c8"
1300 acl: path access granted: "f9cafe1212c8"
1301 acl: branch access granted: "911600dab2ae" on branch "default"
1301 acl: branch access granted: "911600dab2ae" on branch "default"
1302 acl: path access granted: "911600dab2ae"
1302 acl: path access granted: "911600dab2ae"
1303 updating the branch cache
1303 listing keys for "phases"
1304 listing keys for "phases"
1304 try to push obsolete markers to remote
1305 try to push obsolete markers to remote
1305 updating the branch cache
1306 checking for updated bookmarks
1306 checking for updated bookmarks
1307 listing keys for "bookmarks"
1307 listing keys for "bookmarks"
1308 repository tip rolled back to revision 0 (undo push)
1308 repository tip rolled back to revision 0 (undo push)
@@ -1501,9 +1501,9 b' No branch acls specified'
1501 acl: path access granted: "911600dab2ae"
1501 acl: path access granted: "911600dab2ae"
1502 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1502 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1503 acl: path access granted: "e8fc755d4d82"
1503 acl: path access granted: "e8fc755d4d82"
1504 updating the branch cache
1504 listing keys for "phases"
1505 listing keys for "phases"
1505 try to push obsolete markers to remote
1506 try to push obsolete markers to remote
1506 updating the branch cache
1507 checking for updated bookmarks
1507 checking for updated bookmarks
1508 listing keys for "bookmarks"
1508 listing keys for "bookmarks"
1509 repository tip rolled back to revision 2 (undo push)
1509 repository tip rolled back to revision 2 (undo push)
@@ -1807,9 +1807,9 b' Branch acl allow other'
1807 acl: path access granted: "911600dab2ae"
1807 acl: path access granted: "911600dab2ae"
1808 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1808 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1809 acl: path access granted: "e8fc755d4d82"
1809 acl: path access granted: "e8fc755d4d82"
1810 updating the branch cache
1810 listing keys for "phases"
1811 listing keys for "phases"
1811 try to push obsolete markers to remote
1812 try to push obsolete markers to remote
1812 updating the branch cache
1813 checking for updated bookmarks
1813 checking for updated bookmarks
1814 listing keys for "bookmarks"
1814 listing keys for "bookmarks"
1815 repository tip rolled back to revision 2 (undo push)
1815 repository tip rolled back to revision 2 (undo push)
@@ -1895,9 +1895,9 b' push foobar into the remote'
1895 acl: path access granted: "911600dab2ae"
1895 acl: path access granted: "911600dab2ae"
1896 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1896 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
1897 acl: path access granted: "e8fc755d4d82"
1897 acl: path access granted: "e8fc755d4d82"
1898 updating the branch cache
1898 listing keys for "phases"
1899 listing keys for "phases"
1899 try to push obsolete markers to remote
1900 try to push obsolete markers to remote
1900 updating the branch cache
1901 checking for updated bookmarks
1901 checking for updated bookmarks
1902 listing keys for "bookmarks"
1902 listing keys for "bookmarks"
1903 repository tip rolled back to revision 2 (undo push)
1903 repository tip rolled back to revision 2 (undo push)
@@ -2056,9 +2056,9 b" User 'astro' must not be denied"
2056 acl: path access granted: "911600dab2ae"
2056 acl: path access granted: "911600dab2ae"
2057 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2057 acl: branch access granted: "e8fc755d4d82" on branch "foobar"
2058 acl: path access granted: "e8fc755d4d82"
2058 acl: path access granted: "e8fc755d4d82"
2059 updating the branch cache
2059 listing keys for "phases"
2060 listing keys for "phases"
2060 try to push obsolete markers to remote
2061 try to push obsolete markers to remote
2061 updating the branch cache
2062 checking for updated bookmarks
2062 checking for updated bookmarks
2063 listing keys for "bookmarks"
2063 listing keys for "bookmarks"
2064 repository tip rolled back to revision 2 (undo push)
2064 repository tip rolled back to revision 2 (undo push)
@@ -34,6 +34,7 b' Pushing to a local read-only repo that c'
34
34
35 $ hg -R b push a
35 $ hg -R b push a
36 pushing to a
36 pushing to a
37 searching for changes
37 abort: could not lock repository a: Permission denied
38 abort: could not lock repository a: Permission denied
38 [255]
39 [255]
39
40
General Comments 0
You need to be logged in to leave comments. Login now