From 05ac3c408b9be57063421cfb8de6314719385828 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont (@ardumont)" <antoine.romain.dumont@gmail.com> Date: Sat, 11 Jun 2016 01:58:18 +0200 Subject: [PATCH] Remove dead code --- swh/model/git.py | 231 ----------------- swh/model/tests/test_git.py | 483 ------------------------------------ 2 files changed, 714 deletions(-) diff --git a/swh/model/git.py b/swh/model/git.py index 3fea28d9..842ecd8a 100644 --- a/swh/model/git.py +++ b/swh/model/git.py @@ -530,237 +530,6 @@ def compute_hashes_from_directory(rootdir, return ls_hashes -def recompute_sha1_in_memory(root, deeper_rootdir, objects): - """TODO: Use git.walk_and_compute_sha1_from_directory_2 - - Recompute git sha1 from directory deeper_rootdir to root. - - This function relies exclusively on `objects` for hashes. It - expects the deeper_rootdir and every key below that path to be - already updated. - - Args: - - root: Upper root directory (so same as - objects[ROOT_TREE_KEY][0]['path']) - - - deeper_rootdir: Upper root directory from which the git hash - computation has alredy been updated. - - - objects: objects dictionary as per returned by - `walk_and_compute_sha1_from_directory` - - Returns: - Dictionary of entries with keys <path-name> and as values a list of - directory entries. - Those are list of dictionary with keys: - - 'perms' - - 'type' - - 'name' - - 'sha1_git' - - and specifically content: 'sha1', 'sha256', ... - - Note: - One special key is ROOT_TREE_KEY to indicate the upper root of the - directory (this is the revision's target directory). - - Raises: - Nothing - If something is raised, this is a programmatic error. - - """ - # list of paths to update from bottom to top - upper_root = os.path.dirname(root) - rootdir = os.path.dirname(deeper_rootdir) - while rootdir != upper_root: - files = objects[rootdir] - ls_hashes = [] - for hashfile in files: - fulldirname = hashfile['path'] - if hashfile['type'] == GitType.TREE: - tree_hash = compute_tree_metadata(fulldirname, objects) - ls_hashes.append(tree_hash) - else: - ls_hashes.append(hashfile) - - objects[rootdir] = ls_hashes - - parent = os.path.dirname(rootdir) - rootdir = parent - - # update root - - root_tree_hash = compute_directory_git_sha1(root, objects) - objects[ROOT_TREE_KEY][0]['sha1_git'] = root_tree_hash - return objects - - -def commonpath(paths): - """Given a sequence of path names, returns the longest common sub-path. - - Copied from Python3.5 - - """ - - if not paths: - raise ValueError('commonpath() arg is an empty sequence') - - if isinstance(paths[0], bytes): - sep = b'/' - curdir = b'.' - else: - sep = '/' - curdir = '.' - - try: - split_paths = [path.split(sep) for path in paths] - - try: - isabs, = set(p[:1] == sep for p in paths) - except ValueError: - raise ValueError("Can't mix absolute and relative paths") - - split_paths = [ - [c for c in s if c and c != curdir] for s in split_paths] - s1 = min(split_paths) - s2 = max(split_paths) - common = s1 - for i, c in enumerate(s1): - if c != s2[i]: - common = s1[:i] - break - - prefix = sep if isabs else sep[:0] - return prefix + sep.join(common) - except (TypeError, AttributeError): - raise - - -def __remove_paths_from_objects(objects, rootpaths, - dir_ok_fn=default_validation_dir): - """Given top paths to remove, remove all paths and descendants from - objects. - - Args: - objects: The dictionary of paths to clean up. - rootpaths: The rootpaths to remove from objects. - - dir_ok_fn: Validation function on folder/file names. - Default to accept all. - - Returns: - Objects dictionary without the rootpaths and their descendants. - - """ - dirpaths_to_clean = set() - for path in rootpaths: - path_list = objects.pop(path, None) - if path_list: # need to remove the children directories too - for child in path_list: - if child['type'] == GitType.TREE: - dirpaths_to_clean.add(child['path']) - - parent = os.path.dirname(path) - # Is the parent still ok? (e.g. not an empty dir for example) - parent_check = dir_ok_fn(parent) - if not parent_check and parent not in dirpaths_to_clean: - dirpaths_to_clean.add(parent) - else: - # we need to pop the reference to path in the parent list - if objects.get(parent): - objects[parent] = filter( - lambda p: p != path, - objects.get(parent, [])) - - if dirpaths_to_clean: - objects = __remove_paths_from_objects(objects, - dirpaths_to_clean, - dir_ok_fn) - - return objects - - -def update_checksums_from(changed_paths, objects, - dir_ok_fn=default_validation_dir, - remove_empty_folder=False): - """Given a list of changed paths, recompute the checksums only where - needed. - - Args: - changed_paths: Dictionary list representing path changes. - A dictionary has the form: - - path: the full path to the file Added, Modified or Deleted - - action: A, M or D - objects: dictionary returned by `walk_and_compute_sha1_from_directory`. - - dir_ok_fn: Validation function on folder/file names. - Default to accept all. - - Returns: - Dictionary returned by `walk_and_compute_sha1_from_directory` - updated (mutated) according to latest filesystem modifications. - - """ - root = objects[ROOT_TREE_KEY][0]['path'] - if root.endswith(b'/'): - root = root.rstrip(b'/') - - paths = set() # contain the list of impacted paths (A, D, M) - paths_to_remove = set() # will contain the list of deletion paths (only D) - # a first round-trip to ensure we don't need to... - for changed_path in changed_paths: - path = changed_path['path'] - - parent = os.path.dirname(path) - if parent == root: # ... recompute everything anyway - return walk_and_compute_sha1_from_directory( - root, - dir_ok_fn=dir_ok_fn, - remove_empty_folder=remove_empty_folder) - - if changed_path['action'] == 'D': # (D)elete - paths_to_remove.add(path) - - paths.add(parent) - - # no modification on paths (paths also contain deletion paths if any) - if not paths: - return objects - - rootdir = commonpath(list(paths)) - - if paths_to_remove: - # Now we can remove the deleted directories from objects dictionary - objects = __remove_paths_from_objects(objects, - paths_to_remove, - dir_ok_fn) - - # Recompute from disk the checksums from impacted common ancestor - # rootdir changes. - while not objects.get(rootdir, None): - # it could happened that the path is not found. - # In the case of an ignored folder for example. - # So we'll find the next existing parent - rootdir = os.path.dirname(rootdir) - - if rootdir == root: # fallback, if we hit root, walk - # everything anyway - return walk_and_compute_sha1_from_directory( - root, - dir_ok_fn=dir_ok_fn, - remove_empty_folder=remove_empty_folder) - - hashes = walk_and_compute_sha1_from_directory( - rootdir, - dir_ok_fn=dir_ok_fn, - with_root_tree=False, - remove_empty_folder=remove_empty_folder) - - # Then update the original objects with new - # checksums for the arborescence tree below rootdir - objects.update(hashes) - - # Recompute hashes in memory from rootdir to root - return recompute_sha1_in_memory(root, rootdir, objects) - - def objects_per_type(filter_type, objects_per_path): """Given an object dictionary returned by `swh.model.git.compute_hashes_from_directory`, yields diff --git a/swh/model/tests/test_git.py b/swh/model/tests/test_git.py index 4d1470d8..10003e13 100644 --- a/swh/model/tests/test_git.py +++ b/swh/model/tests/test_git.py @@ -243,486 +243,3 @@ class GitHashFromScratch(GitHashWalkArborescenceTree): # should give us the same checksums as the second round self.assertEquals(actual_hashes, expected_hashes) - - -class GitHashUpdate(GitHashWalkArborescenceTree): - """Test `walk and git hash only on modified fs` functions. - - """ - @istest - def update_checksums_from_add_new_file(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way (add a new file) - # update the actual git checksums from the deeper tree modified - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # update the existing file - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo/new') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # walk1 (this will be our expectation) - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_from_add_new_file_with_validation(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way (add a new file) - # update the actual git checksums from the deeper tree modified - # + Add some validation on some file to ignore - - def dir_ok_fn(dirpath): - return b'empty-folder' not in dirpath - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, dir_ok_fn=dir_ok_fn) - - # update the existing file - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo/new') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # walk1 (this will be our expectation) - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, dir_ok_fn=dir_ok_fn) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_from_add_new_file_remove_empty_folder(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way (add a new file) - # update the actual git checksums from the deeper tree modified - # + Add some validation on some file to ignore - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, remove_empty_folder=True) - - # update the existing file - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo/new') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # walk1 (this will be our expectation) - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, remove_empty_folder=True) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_new_file_with_validation_and_ignore_empty_dir(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way (add a new file) - # update the actual git checksums from the deeper tree modified - # + Add some validation on some file to ignore - # + ignore empty folder - - def dir_ok_fn(dirpath): - return b'some-binary' not in dirpath - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, dir_ok_fn=dir_ok_fn, remove_empty_folder=True) - - # update the existing file - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo/new') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # walk1 (this will be our expectation) - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, dir_ok_fn=dir_ok_fn, remove_empty_folder=True) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_from_modify_existing_file(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way () - # update the actual git checksums where only the modification is needed - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # update existing file - changed_path = os.path.join( - self.tmp_root_path, - b'sample-folder/bar/barfoo/another-quote.org') - with open(changed_path, 'wb+') as f: - f.write(b'I have a dream') - - # walk1 (this will be our expectation) - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'M'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_no_change(self): - # when - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # nothing changes on disk - - # then - actual_dict = git.update_checksums_from([], expected_dict) - - self.assertEquals(actual_dict, expected_dict) - - @istest - def update_checksums_delete_existing_file(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way (delete a file) - # update the actual git checksums from the deeper tree modified - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # Remove folder - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo') - shutil.rmtree(changed_path) - - # Actually walking the fs will be the resulting expectation - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'D'}], - objects) - - self.assertEquals(actual_dict, expected_dict) - - @istest - def update_checksums_from_multiple_fs_modifications(self): - # make a temporary arborescence tree to hash without ignoring anything - # update the disk in some way (modify a file, add a new, delete one) - # update the actual git checksums from the deeper tree modified - - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # Actions on disk (imagine a checkout of some form) - - # 1. Create a new file - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo/new') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # 2. update the existing file - changed_path1 = os.path.join( - self.tmp_root_path, - b'sample-folder/bar/barfoo/another-quote.org') - with open(changed_path1, 'wb') as f: - f.write(b'new line') - - # 3. Remove some folder - changed_path2 = os.path.join(self.tmp_root_path, - b'sample-folder/foo') - shutil.rmtree(changed_path2) - - # Actually walking the fs will be the resulting expectation - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}, - {'path': changed_path1, 'action': 'M'}, - {'path': changed_path2, 'action': 'D'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_from_common_ancestor(self): - # when - # Add some new arborescence below a folder destined to be removed - # want to check that old keys does not remain - future_folder_to_remove = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo') - - # add .../barfoo/hello/world under (.../barfoo which will be destroyed) - new_folder = os.path.join(future_folder_to_remove, b'hello') - os.makedirs(new_folder, exist_ok=True) - with open(os.path.join(future_folder_to_remove, b'world'), 'wb') as f: - f.write(b"i'm sad 'cause i'm destined to be removed...") - - # now we scan the disk - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - assert objects[future_folder_to_remove] - - # Actions on disk (to simulate a checkout of some sort) - - # 1. Create a new file - changed_path = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo/new') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # 2. update the existing file - changed_path1 = os.path.join( - self.tmp_root_path, - b'sample-folder/bar/barfoo/another-quote.org') - with open(changed_path1, 'wb') as f: - f.write(b'new line') - - # 3. Remove folder - shutil.rmtree(future_folder_to_remove) - - # Actually walking the fs will be the resulting expectation - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}, - {'path': changed_path1, 'action': 'M'}, - {'path': future_folder_to_remove, 'action': 'D'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def update_checksums_detects_recomputation_from_all_is_needed(self): - # when - objects = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # Actions on disk (imagine a checkout of some form) - - # 1. Create a new file - changed_path = os.path.join(self.tmp_root_path, - b'new-file-at-root') - with open(changed_path, 'wb') as f: - f.write(b'new line') - - # 2. update the existing file - changed_path1 = os.path.join( - self.tmp_root_path, - b'sample-folder/bar/barfoo/another-quote.org') - with open(changed_path1, 'wb') as f: - f.write(b'new line') - - # 3. Remove some folder - changed_path2 = os.path.join(self.tmp_root_path, - b'sample-folder/foo') - - # 3. Remove some folder - changed_path2 = os.path.join(self.tmp_root_path, - b'sample-folder/bar/barfoo') - shutil.rmtree(changed_path2) - - # Actually walking the fs will be the resulting expectation - expected_dict = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path) - - # then - actual_dict = git.update_checksums_from( - [{'path': changed_path, 'action': 'A'}, - {'path': changed_path1, 'action': 'M'}, - {'path': changed_path2, 'action': 'D'}], - objects) - - self.assertEquals(expected_dict, actual_dict) - - @istest - def commonpath(self): - paths = ['r/0/h', - 'r/1/d', 'r/1/i/a', 'r/1/i/b', 'r/1/i/c', - 'r/2/e', 'r/2/f', 'r/2/g'] - self.assertEquals(git.commonpath(paths), 'r') - - paths = ['r/1/d', 'r/1/i/a', 'r/1/i/b', 'r/1/i/c'] - self.assertEquals(git.commonpath(paths), 'r/1') - - paths = ['/a/r/2/g', '/a/r/1/i/c', '/a/r/0/h'] - self.assertEquals(git.commonpath(paths), '/a/r') - - paths = [b'/a/r/2/g', b'/b/r/1/i/c', b'/c/r/0/h'] - self.assertEquals(git.commonpath(paths), b'/') - - paths = ['a/z', 'a/z', 'a/z'] - self.assertEquals(git.commonpath(paths), 'a/z') - - paths = ['0'] - self.assertEquals(git.commonpath(paths), '0') - - -def untar(archive, dest): - # cleanup - shutil.rmtree(dest) - os.mkdir(dest) - # untar - cmd = [b'tar', b'xf', archive, b'-C', dest] - subprocess.check_output(cmd) - - -def ignore_svn_folder(dirpath): - return b'.svn' not in dirpath - - -@attr('fs') -class GitHashUpdateRealUseCase(unittest.TestCase): - """Test `walk and git hash only on modified fs` functions. - - """ - def setUp(self): - self.tmp_root_path = tempfile.mkdtemp().encode('utf-8') - - archives_folder = os.path.join( - os.path.dirname(__file__).encode('utf-8'), - b'../../../..', - b'swh-storage-testdata', - b'svn-folders') - - self.pkg_doc_linux_r10 = os.path.join(archives_folder, - b'pkg-doc-linux-r10.tgz') - self.pkg_doc_linux_r11 = os.path.join(archives_folder, - b'pkg-doc-linux-r11.tgz') - self.pkg_doc_linux_r12 = os.path.join(archives_folder, - b'pkg-doc-linux-r12.tgz') - - def tearDown(self): - if os.path.exists(self.tmp_root_path): - shutil.rmtree(self.tmp_root_path) - - @istest - def use_case_1_r10_r11(self): - # given - # untar the svn revision 10 - untar(self.pkg_doc_linux_r10, self.tmp_root_path) - - objects_r10 = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, - ignore_svn_folder) - - # untar the svn revision 11 - untar(self.pkg_doc_linux_r11, self.tmp_root_path) - - objects_r11 = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, - ignore_svn_folder) - - assert objects_r10 != objects_r11 - - changes = [ - {'action': 'D', 'path': os.path.join(self.tmp_root_path, b'copyrights/non-free/Kiosk')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'copyrights/undistributable/Kiosk')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'copyrights/undistributable')}, # noqa - {'action': 'D', 'path': os.path.join(self.tmp_root_path, b'copyrights/non-free/UPS')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'copyrights/undistributable/UPS')} # noqa - ] - - # when - # update from objects from previous revision (r10) with - # actual changes from r10 to r11 - actual_objects = git.update_checksums_from(changes, - objects_r10, - ignore_svn_folder) - - # then - self.assertEquals(actual_objects, objects_r11) - - @istest - def use_case_2_r11_r12(self): - # given - # untar the svn revision 11 - untar(self.pkg_doc_linux_r11, self.tmp_root_path) - - objects_r11 = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, - ignore_svn_folder) - - # untar the svn revision 12 - untar(self.pkg_doc_linux_r12, self.tmp_root_path) - - objects_r12 = git.walk_and_compute_sha1_from_directory( - self.tmp_root_path, - ignore_svn_folder) - - assert objects_r11 != objects_r12 - changes = [ - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk')}, # noqa - {'action': 'D', 'path': os.path.join(self.tmp_root_path, b'copyrights')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/copyright.head')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/split-package')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-base.faq')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/make-copyright')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.menu')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/redirect.patch')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.overrides')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.prerm')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/README.updating')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.preinst')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.dirs')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/changelog')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-text.README.Debian')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/html2docs')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/rules')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.postrm')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/make-omf')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-text.preinst')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.postinst')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/copyrights')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/control')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-text.dirs')}, # noqa - {'action': 'A', 'path': os.path.join(self.tmp_root_path, b'trunk/doc-linux/debian/doc-linux-html.README.Debian')} # noqa - ] - - # when - # update from objects from previous revision (r11) with - # actual changes from r11 to r12 - actual_objects = git.update_checksums_from(changes, - objects_r11, - ignore_svn_folder) - - # then - self.assertEquals(actual_objects, objects_r12) -- GitLab