##// END OF EJS Templates
largefiles: don't mute and obfuscate http errors when putlfile fails...
Mads Kiilerich -
r26825:78539633 stable
parent child Browse files
Show More
@@ -86,15 +86,14 b' def wirereposetup(ui, repo):'
86 # input file-like into a bundle before sending it, so we can't use
86 # input file-like into a bundle before sending it, so we can't use
87 # it ...
87 # it ...
88 if issubclass(self.__class__, httppeer.httppeer):
88 if issubclass(self.__class__, httppeer.httppeer):
89 res = None
89 res = self._call('putlfile', data=fd, sha=sha,
90 headers={'content-type':'application/mercurial-0.1'})
90 try:
91 try:
91 res = self._call('putlfile', data=fd, sha=sha,
92 headers={'content-type':'application/mercurial-0.1'})
93 d, output = res.split('\n', 1)
92 d, output = res.split('\n', 1)
94 for l in output.splitlines(True):
93 for l in output.splitlines(True):
95 self.ui.warn(_('remote: '), l) # assume l ends with \n
94 self.ui.warn(_('remote: '), l) # assume l ends with \n
96 return int(d)
95 return int(d)
97 except (ValueError, urllib2.HTTPError):
96 except ValueError:
98 self.ui.warn(_('unexpected putlfile response: %r\n') % res)
97 self.ui.warn(_('unexpected putlfile response: %r\n') % res)
99 return 1
98 return 1
100 # ... but we can't use sshrepository._call because the data=
99 # ... but we can't use sshrepository._call because the data=
@@ -209,12 +209,10 b' Test coverage of error handling from put'
209 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
209 $ hg serve -R ../mirror -d -p $HGPORT1 --pid-file hg.pid --config largefiles.usercache=$TESTTMP/mirrorcache
210 $ cat hg.pid >> $DAEMON_PIDS
210 $ cat hg.pid >> $DAEMON_PIDS
211
211
212 (the following push fails but doesn't show why)
213 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
212 $ hg push http://localhost:$HGPORT1 -f --config files.usercache=nocache
214 pushing to http://localhost:$HGPORT1/
213 pushing to http://localhost:$HGPORT1/
215 searching for changes
214 searching for changes
216 unexpected putlfile response: None
215 abort: remotestore: could not open file $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020: HTTP Error 403: ssl required
217 abort: remotestore: could not put $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020 to remote store http://localhost:$HGPORT1/
218 [255]
216 [255]
219
217
220 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
218 $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
General Comments 0
You need to be logged in to leave comments. Login now