##// END OF EJS Templates
narrow: check for servers' narrow support before doing anything (BC)...
Pulkit Goyal -
r40000:06e75fbf default
parent child Browse files
Show More
@@ -134,7 +134,7 b' def pullbundle2extraprepare(orig, pullop'
134 return orig(pullop, kwargs)
134 return orig(pullop, kwargs)
135
135
136 if wireprotoserver.NARROWCAP not in pullop.remote.capabilities():
136 if wireprotoserver.NARROWCAP not in pullop.remote.capabilities():
137 raise error.Abort(_("server doesn't support narrow clones"))
137 raise error.Abort(_("server does not support narrow clones"))
138 orig(pullop, kwargs)
138 orig(pullop, kwargs)
139 kwargs['narrow'] = True
139 kwargs['narrow'] = True
140 include, exclude = repo.narrowpats
140 include, exclude = repo.narrowpats
@@ -408,6 +408,13 b' def trackedcmd(ui, repo, remotepath=None'
408 url, branches = hg.parseurl(remotepath)
408 url, branches = hg.parseurl(remotepath)
409 ui.status(_('comparing with %s\n') % util.hidepassword(url))
409 ui.status(_('comparing with %s\n') % util.hidepassword(url))
410 remote = hg.peer(repo, opts, url)
410 remote = hg.peer(repo, opts, url)
411
412 # check narrow support before doing anything if widening needs to be
413 # performed. In future we should also abort if client is ellipses and
414 # server does not support ellipses
415 if widening and wireprotoserver.NARROWCAP not in remote.capabilities():
416 raise error.Abort(_("server does not support narrow clones"))
417
411 commoninc = discovery.findcommonincoming(repo, remote)
418 commoninc = discovery.findcommonincoming(repo, remote)
412
419
413 oldincludes, oldexcludes = repo.narrowpats
420 oldincludes, oldexcludes = repo.narrowpats
@@ -39,7 +39,7 b' Verify that narrow is advertised in the '
39
39
40 $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone
40 $ hg clone --narrow --include f1 http://localhost:$HGPORT1/ narrowclone
41 requesting all changes
41 requesting all changes
42 abort: server doesn't support narrow clones
42 abort: server does not support narrow clones
43 [255]
43 [255]
44
44
45 Make a narrow clone (via HGPORT2), then try to narrow and widen
45 Make a narrow clone (via HGPORT2), then try to narrow and widen
@@ -60,7 +60,5 b' gracefully:'
60 looking for local changes to affected paths
60 looking for local changes to affected paths
61 $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
61 $ hg tracked --addinclude f1 http://localhost:$HGPORT1/
62 comparing with http://localhost:$HGPORT1/
62 comparing with http://localhost:$HGPORT1/
63 searching for changes
63 abort: server does not support narrow clones
64 no changes found
65 abort: server doesn't support narrow clones
66 [255]
64 [255]
@@ -65,7 +65,7 b' BUG: local-to-local narrow clones should'
65
65
66 $ hg clone --narrow master narrow-via-localpeer --noupdate --include "dir/src/f10"
66 $ hg clone --narrow master narrow-via-localpeer --noupdate --include "dir/src/f10"
67 requesting all changes
67 requesting all changes
68 abort: server doesn't support narrow clones
68 abort: server does not support narrow clones
69 [255]
69 [255]
70 $ hg tracked -R narrow-via-localpeer
70 $ hg tracked -R narrow-via-localpeer
71 abort: repository narrow-via-localpeer not found!
71 abort: repository narrow-via-localpeer not found!
General Comments 0
You need to be logged in to leave comments. Login now