Show More
@@ -2105,10 +2105,12 b' def pull(ui, repo, source="default", **o' | |||
|
2105 | 2105 | other = hg.repository(ui, source) |
|
2106 | 2106 | ui.status(_('pulling from %s\n') % (source)) |
|
2107 | 2107 | revs = None |
|
2108 |
if opts['rev'] |
|
|
2109 | raise util.Abort(_("pull -r doesn't work for remote repositories yet")) | |
|
2110 | elif opts['rev']: | |
|
2111 | revs = [other.lookup(rev) for rev in opts['rev']] | |
|
2108 | if opts['rev']: | |
|
2109 | if 'lookup' in other.capabilities: | |
|
2110 | revs = [other.lookup(rev) for rev in opts['rev']] | |
|
2111 | else: | |
|
2112 | error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.") | |
|
2113 | raise util.Abort(error) | |
|
2112 | 2114 | modheads = repo.pull(other, heads=revs, force=opts['force']) |
|
2113 | 2115 | return postincoming(ui, repo, modheads, opts['update']) |
|
2114 | 2116 |
@@ -176,9 +176,10 b' def clone(ui, source, dest=None, pull=Fa' | |||
|
176 | 176 | else: |
|
177 | 177 | revs = None |
|
178 | 178 | if rev: |
|
179 |
if not src_repo. |
|
|
180 |
raise util.Abort(_(" |
|
|
181 |
" |
|
|
179 | if 'lookup' not in src_repo.capabilities: | |
|
180 | raise util.Abort(_("src repository does not support revision " | |
|
181 | "lookup and so doesn't support clone by " | |
|
182 | "revision")) | |
|
182 | 183 | revs = [src_repo.lookup(r) for r in rev] |
|
183 | 184 | |
|
184 | 185 | if dest_repo.local(): |
@@ -15,7 +15,7 b' demandload(globals(), "re lock transacti' | |||
|
15 | 15 | demandload(globals(), "os revlog time util") |
|
16 | 16 | |
|
17 | 17 | class localrepository(repo.repository): |
|
18 | capabilities = () | |
|
18 | capabilities = ('lookup', 'changegroupsubset') | |
|
19 | 19 | |
|
20 | 20 | def __del__(self): |
|
21 | 21 | self.transhandle = None |
@@ -1241,6 +1241,8 b' class localrepository(repo.repository):' | |||
|
1241 | 1241 | if heads is None: |
|
1242 | 1242 | cg = remote.changegroup(fetch, 'pull') |
|
1243 | 1243 | else: |
|
1244 | if 'changegroupsubset' not in remote.capabilities: | |
|
1245 | raise util.Abort(_("Partial pull cannot be done because other repository doesn't support changegroupsubset.")) | |
|
1244 | 1246 | cg = remote.changegroupsubset(fetch, heads, 'pull') |
|
1245 | 1247 | return self.addchangegroup(cg, 'pull', remote.url()) |
|
1246 | 1248 | finally: |
General Comments 0
You need to be logged in to leave comments.
Login now