def get_location(self, path, rev, old_rev): try: results = ra.get_locations(self.ra_session, path, rev, [old_rev]) except core.SubversionException, e: _fix_subversion_exception(e) if e.apr_err == core.SVN_ERR_FS_NOT_FOUND: raise vclib.ItemNotFound(path) raise
def get_location(svnrepos, path, rev, old_rev): try: results = ra.get_locations(svnrepos.ra_session, path, rev, [old_rev], svnrepos.pool) except core.SubversionException, e: if e.apr_err == core.SVN_ERR_FS_NOT_FOUND: raise vclib.ItemNotFound(path) raise
def test_get_locations(self): locations = ra.get_locations(self.ra_ctx, "trunk/README.txt", 2, list(range(1, 5))) self.assertEqual(locations, { 2: '/trunk/README.txt', 3: '/trunk/README.txt', 4: '/trunk/README.txt' })
def get_location(self, path, rev, old_rev): try: results = ra.get_locations(self.ra_session, path, rev, [old_rev]) except core.SubversionException as e: if e.apr_err == core.SVN_ERR_FS_NOT_FOUND: raise vclib.ItemNotFound(path) raise try: old_path = results[old_rev] except KeyError: raise vclib.ItemNotFound(path) old_path = _cleanup_path(_to_str(old_path)) old_path_parts = _path_parts(old_path) # Check access (lying about path types) if not vclib.check_path_access(self, old_path_parts, vclib.FILE, old_rev): raise vclib.ItemNotFound(path) return old_path
def test_get_locations(self): locations = ra.get_locations(self.ra_ctx, "trunk/README.txt", 2, range(1,5)) self.assertEqual(locations, { 2: '/trunk/README.txt', 3: '/trunk/README.txt', 4: '/trunk/README.txt'})
def test_get_locations(self): locations = ra.get_locations(self.ra_ctx, "trunk/README.txt", 2, list(range(1, 5))) self.assertEqual(locations, {2: "/trunk/README.txt", 3: "/trunk/README.txt", 4: "/trunk/README.txt"})