##// END OF EJS Templates
largefiles: adapt remotestore._getfile to batched statlfile...
Mads Kiilerich -
r18484:d43823f9 stable
parent child Browse files
Show More
@@ -48,11 +48,14 b' class remotestore(basestore.basestore):'
48
48
49 def _getfile(self, tmpfile, filename, hash):
49 def _getfile(self, tmpfile, filename, hash):
50 # quit if the largefile isn't there
50 # quit if the largefile isn't there
51 stat = self._stat(hash)
51 stat = self._stat([hash])[hash]
52 if stat == 1:
52 if stat == 1:
53 raise util.Abort(_('remotestore: largefile %s is invalid') % hash)
53 raise util.Abort(_('remotestore: largefile %s is invalid') % hash)
54 elif stat == 2:
54 elif stat == 2:
55 raise util.Abort(_('remotestore: largefile %s is missing') % hash)
55 raise util.Abort(_('remotestore: largefile %s is missing') % hash)
56 elif stat != 0:
57 raise RuntimeError('error getting file: unexpected response from '
58 'statlfile (%r)' % stat)
56
59
57 try:
60 try:
58 length, infile = self._get(hash)
61 length, infile = self._get(hash)
@@ -1574,18 +1574,16 b' largefiles pulled on update - a largefil'
1574 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1574 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1575 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1575 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1576 getting changed largefiles
1576 getting changed largefiles
1577 error getting id 02a439e5c31c526465ab1a0ca1f431f76b827b90 from url http://localhost:$HGPORT2/ for file f1: HTTP Error 500: Internal Server Error
1577 abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing
1578 0 largefiles updated, 0 removed
1578 [255]
1579 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1580 $ hg -R http-clone up -Cqr null
1579 $ hg -R http-clone up -Cqr null
1581
1580
1582 largefiles pulled on update - a largefile corrupted on the server:
1581 largefiles pulled on update - a largefile corrupted on the server:
1583 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1582 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1584 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1583 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1585 getting changed largefiles
1584 getting changed largefiles
1586 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1585 abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is invalid
1587 0 largefiles updated, 0 removed
1586 [255]
1588 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1589 $ hg -R http-clone st
1587 $ hg -R http-clone st
1590 ! f1
1588 ! f1
1591 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1589 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
@@ -1602,7 +1600,6 b' largefiles pulled on update - a largefil'
1602 verified contents of 1 revisions of 1 largefiles
1600 verified contents of 1 revisions of 1 largefiles
1603 [1]
1601 [1]
1604 $ hg -R http-clone up -Cqr null
1602 $ hg -R http-clone up -Cqr null
1605 $ rm http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1606
1603
1607 largefiles pulled on update - no server side problems:
1604 largefiles pulled on update - no server side problems:
1608 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1605 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
General Comments 0
You need to be logged in to leave comments. Login now