##// END OF EJS Templates
largefiles: hide passwords in URLs in ui messages
Mads Kiilerich -
r19950:cce7ab96 stable
parent child Browse files
Show More
@@ -26,10 +26,11 b' class StoreError(Exception):'
26
26
27 def longmessage(self):
27 def longmessage(self):
28 return (_("error getting id %s from url %s for file %s: %s\n") %
28 return (_("error getting id %s from url %s for file %s: %s\n") %
29 (self.hash, self.url, self.filename, self.detail))
29 (self.hash, util.hidepassword(self.url), self.filename,
30 self.detail))
30
31
31 def __str__(self):
32 def __str__(self):
32 return "%s: %s" % (self.url, self.detail)
33 return "%s: %s" % (util.hidepassword(self.url), self.detail)
33
34
34 class basestore(object):
35 class basestore(object):
35 def __init__(self, ui, repo, url):
36 def __init__(self, ui, repo, url):
@@ -69,7 +70,7 b' class basestore(object):'
69
70
70 if not available.get(hash):
71 if not available.get(hash):
71 ui.warn(_('%s: largefile %s not available from %s\n')
72 ui.warn(_('%s: largefile %s not available from %s\n')
72 % (filename, hash, self.url))
73 % (filename, hash, util.hidepassword(self.url)))
73 missing.append(filename)
74 missing.append(filename)
74 continue
75 continue
75
76
@@ -214,4 +215,5 b' def _openstore(repo, remote=None, put=Fa'
214 except lfutil.storeprotonotcapable:
215 except lfutil.storeprotonotcapable:
215 pass
216 pass
216
217
217 raise util.Abort(_('%s does not appear to be a largefile store') % path)
218 raise util.Abort(_('%s does not appear to be a largefile store') %
219 util.hidepassword(path))
@@ -24,9 +24,10 b' class remotestore(basestore.basestore):'
24 if self.sendfile(source, hash):
24 if self.sendfile(source, hash):
25 raise util.Abort(
25 raise util.Abort(
26 _('remotestore: could not put %s to remote store %s')
26 _('remotestore: could not put %s to remote store %s')
27 % (source, self.url))
27 % (source, util.hidepassword(self.url)))
28 self.ui.debug(
28 self.ui.debug(
29 _('remotestore: put %s to remote store %s\n') % (source, self.url))
29 _('remotestore: put %s to remote store %s\n')
30 % (source, util.hidepassword(self.url)))
30
31
31 def exists(self, hashes):
32 def exists(self, hashes):
32 return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
33 return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
@@ -57,7 +58,8 b' class remotestore(basestore.basestore):'
57 # This usually indicates a connection problem, so don't
58 # This usually indicates a connection problem, so don't
58 # keep trying with the other files... they will probably
59 # keep trying with the other files... they will probably
59 # all fail too.
60 # all fail too.
60 raise util.Abort('%s: %s' % (self.url, e.reason))
61 raise util.Abort('%s: %s' %
62 (util.hidepassword(self.url), e.reason))
61 except IOError, e:
63 except IOError, e:
62 raise basestore.StoreError(filename, hash, self.url, str(e))
64 raise basestore.StoreError(filename, hash, self.url, str(e))
63
65
@@ -47,7 +47,7 b' but there is no cache file for it. So, '
47
47
48 $ hg update -r0
48 $ hg update -r0
49 getting changed largefiles
49 getting changed largefiles
50 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror (glob)
50 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file://$TESTTMP/mirror (glob)
51 0 largefiles updated, 0 removed
51 0 largefiles updated, 0 removed
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 $ hg status
53 $ hg status
@@ -64,7 +64,7 b' Update working directory to tip, again.'
64
64
65 $ hg update -r0
65 $ hg update -r0
66 getting changed largefiles
66 getting changed largefiles
67 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror (glob)
67 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file://$TESTTMP/mirror (glob)
68 0 largefiles updated, 0 removed
68 0 largefiles updated, 0 removed
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 $ hg status
70 $ hg status
@@ -1280,7 +1280,7 b' Update to revision with missing largefil'
1280 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1280 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1281 $ hg up -r 6
1281 $ hg up -r 6
1282 getting changed largefiles
1282 getting changed largefiles
1283 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d (glob)
1283 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1284 1 largefiles updated, 2 removed
1284 1 largefiles updated, 2 removed
1285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1286 $ rm normal3
1286 $ rm normal3
@@ -1301,7 +1301,7 b' Update to revision with missing largefil'
1301 ! normal3
1301 ! normal3
1302 $ hg up -Cr.
1302 $ hg up -Cr.
1303 getting changed largefiles
1303 getting changed largefiles
1304 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d (glob)
1304 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1305 0 largefiles updated, 0 removed
1305 0 largefiles updated, 0 removed
1306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1307 $ hg st
1307 $ hg st
@@ -1323,7 +1323,7 b' Merge with revision with missing largefi'
1323 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1323 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1324 (branch merge, don't forget to commit)
1324 (branch merge, don't forget to commit)
1325 getting changed largefiles
1325 getting changed largefiles
1326 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d (glob)
1326 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1327 1 largefiles updated, 0 removed
1327 1 largefiles updated, 0 removed
1328
1328
1329 $ hg rollback -q
1329 $ hg rollback -q
@@ -343,7 +343,7 b' Ensure the abort message is useful if a '
343 $ rm largefiles-repo/.hg/largefiles/*
343 $ rm largefiles-repo/.hg/largefiles/*
344 $ hg lfconvert --to-normal issue3519 normalized3519
344 $ hg lfconvert --to-normal issue3519 normalized3519
345 initializing destination normalized3519
345 initializing destination normalized3519
346 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:$TESTTMP/largefiles-repo (glob)
346 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file://$TESTTMP/largefiles-repo (glob)
347 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
347 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
348 [255]
348 [255]
349
349
General Comments 0
You need to be logged in to leave comments. Login now