418 This function handles the repo locking itself.""" |
418 This function handles the repo locking itself.""" |
419 try: |
419 try: |
420 try: |
420 try: |
421 bundle = exchange.readbundle(self.ui, bundle, None) |
421 bundle = exchange.readbundle(self.ui, bundle, None) |
422 ret = exchange.unbundle(self._repo, bundle, heads, b'push', url) |
422 ret = exchange.unbundle(self._repo, bundle, heads, b'push', url) |
423 if util.safehasattr(ret, 'getchunks'): |
423 if hasattr(ret, 'getchunks'): |
424 # This is a bundle20 object, turn it into an unbundler. |
424 # This is a bundle20 object, turn it into an unbundler. |
425 # This little dance should be dropped eventually when the |
425 # This little dance should be dropped eventually when the |
426 # API is finally improved. |
426 # API is finally improved. |
427 stream = util.chunkbuffer(ret.getchunks()) |
427 stream = util.chunkbuffer(ret.getchunks()) |
428 ret = bundle2.getunbundler(self.ui, stream) |
428 ret = bundle2.getunbundler(self.ui, stream) |
1459 self.svfs = self.store.vfs |
1459 self.svfs = self.store.vfs |
1460 self.sjoin = self.store.join |
1460 self.sjoin = self.store.join |
1461 if self.ui.configbool(b'devel', b'all-warnings') or self.ui.configbool( |
1461 if self.ui.configbool(b'devel', b'all-warnings') or self.ui.configbool( |
1462 b'devel', b'check-locks' |
1462 b'devel', b'check-locks' |
1463 ): |
1463 ): |
1464 if util.safehasattr(self.svfs, 'vfs'): # this is filtervfs |
1464 if hasattr(self.svfs, 'vfs'): # this is filtervfs |
1465 self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit) |
1465 self.svfs.vfs.audit = self._getsvfsward(self.svfs.vfs.audit) |
1466 else: # standard vfs |
1466 else: # standard vfs |
1467 self.svfs.audit = self._getsvfsward(self.svfs.audit) |
1467 self.svfs.audit = self._getsvfsward(self.svfs.audit) |
1468 |
1468 |
1469 self._dirstatevalidatewarned = False |
1469 self._dirstatevalidatewarned = False |
1521 def checkvfs(path, mode=None): |
1521 def checkvfs(path, mode=None): |
1522 ret = origfunc(path, mode=mode) |
1522 ret = origfunc(path, mode=mode) |
1523 repo = rref() |
1523 repo = rref() |
1524 if ( |
1524 if ( |
1525 repo is None |
1525 repo is None |
1526 or not util.safehasattr(repo, '_wlockref') |
1526 or not hasattr(repo, '_wlockref') |
1527 or not util.safehasattr(repo, '_lockref') |
1527 or not hasattr(repo, '_lockref') |
1528 ): |
1528 ): |
1529 return |
1529 return |
1530 if mode in (None, b'r', b'rb'): |
1530 if mode in (None, b'r', b'rb'): |
1531 return |
1531 return |
1532 if path.startswith(repo.path): |
1532 if path.startswith(repo.path): |
1570 rref = weakref.ref(self) |
1570 rref = weakref.ref(self) |
1571 |
1571 |
1572 def checksvfs(path, mode=None): |
1572 def checksvfs(path, mode=None): |
1573 ret = origfunc(path, mode=mode) |
1573 ret = origfunc(path, mode=mode) |
1574 repo = rref() |
1574 repo = rref() |
1575 if repo is None or not util.safehasattr(repo, '_lockref'): |
1575 if repo is None or not hasattr(repo, '_lockref'): |
1576 return |
1576 return |
1577 if mode in (None, b'r', b'rb'): |
1577 if mode in (None, b'r', b'rb'): |
1578 return |
1578 return |
1579 if path.startswith(repo.sharedpath): |
1579 if path.startswith(repo.sharedpath): |
1580 # truncate name relative to the repository (.hg) |
1580 # truncate name relative to the repository (.hg) |