equal
deleted
inserted
replaced
61 def wrapper(repo, *args, **kwargs): |
61 def wrapper(repo, *args, **kwargs): |
62 return orig(repo.unfiltered(), *args, **kwargs) |
62 return orig(repo.unfiltered(), *args, **kwargs) |
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): |
70 '''peer for a local repo; reflects only the most recent API''' |
70 '''peer for a local repo; reflects only the most recent API''' |
71 |
71 |
109 return exchange.getbundle(self._repo, source, heads=heads, |
109 return exchange.getbundle(self._repo, source, heads=heads, |
110 common=common, bundlecaps=bundlecaps) |
110 common=common, bundlecaps=bundlecaps) |
111 |
111 |
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 |
|
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) |
114 |
123 |
115 def lock(self): |
124 def lock(self): |
116 return self._repo.lock() |
125 return self._repo.lock() |
117 |
126 |
118 def addchangegroup(self, cg, source, url): |
127 def addchangegroup(self, cg, source, url): |