Parcourir la source

Import upstream version 0.19.13, md5 319977aa2634a58d69ae9ec4244a45de

Jelmer Vernooij il y a 5 ans
Parent
commit
99e09cc22d
7 fichiers modifiés avec 18 ajouts et 84 suppressions
  1. 10 0
      NEWS
  2. 1 1
      PKG-INFO
  3. 1 1
      dulwich.egg-info/PKG-INFO
  4. 1 1
      dulwich/__init__.py
  5. 4 2
      dulwich/repo.py
  6. 0 78
      dulwich/tests/test_porcelain.py
  7. 1 1
      setup.py

+ 10 - 0
NEWS

@@ -1,3 +1,13 @@
+0.19.13	2019-08-19
+
+ BUG FIXES
+
+ * Avoid ``PermissionError``, since it is Python3-specific.
+  (Jelmer Vernooij)
+
+ * Fix regression that added a dependency on C git for the
+   test suite. (Jelmer Vernooij, #720)
+
 0.19.12	2019-08-13
 
  BUG FIXES

+ 1 - 1
PKG-INFO

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: dulwich
-Version: 0.19.12
+Version: 0.19.13
 Summary: Python Git Library
 Home-page: https://www.dulwich.io/
 Author: Jelmer Vernooij

+ 1 - 1
dulwich.egg-info/PKG-INFO

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: dulwich
-Version: 0.19.12
+Version: 0.19.13
 Summary: Python Git Library
 Home-page: https://www.dulwich.io/
 Author: Jelmer Vernooij

+ 1 - 1
dulwich/__init__.py

@@ -22,4 +22,4 @@
 
 """Python implementation of the Git file formats and protocols."""
 
-__version__ = (0, 19, 12)
+__version__ = (0, 19, 13)

+ 4 - 2
dulwich/repo.py

@@ -996,8 +996,10 @@ class Repo(BaseRepo):
         st1 = os.lstat(fname)
         try:
             os.chmod(fname, st1.st_mode ^ stat.S_IXUSR)
-        except PermissionError:
-            return False
+        except EnvironmentError as e:
+            if e.errno == errno.EPERM:
+                return False
+            raise
         st2 = os.lstat(fname)
 
         os.unlink(fname)

+ 0 - 78
dulwich/tests/test_porcelain.py

@@ -52,9 +52,6 @@ from dulwich.tests.utils import (
     make_commit,
     make_object,
     )
-from dulwich.tests.compat.utils import (
-    run_git_or_fail,
-    )
 
 
 def flat_walk_dir(dir_to_walk):
@@ -706,81 +703,6 @@ class DiffTreeTests(PorcelainTestCase):
                             outstream=outstream)
         self.assertEqual(outstream.getvalue(), b"")
 
-    def test_diff_apply(self):
-        # Prepare the repository
-
-        # Create some files and commit them
-        file_list = ["to_exists", "to_modify", "to_delete"]
-        for file in file_list:
-            file_path = os.path.join(self.repo_path, file)
-
-            # Touch the files
-            with open(file_path, "w"):
-                pass
-
-        self.repo.stage(file_list)
-
-        first_commit = self.repo.do_commit(b"The first commit")
-
-        # Make a copy of the repository so we can apply the diff later
-        copy_path = os.path.join(self.test_dir, "copy")
-        shutil.copytree(self.repo_path, copy_path)
-
-        # Do some changes
-        with open(os.path.join(self.repo_path, "to_modify"), "w") as f:
-            f.write("Modified!")
-
-        os.remove(os.path.join(self.repo_path, "to_delete"))
-
-        with open(os.path.join(self.repo_path, "to_add"), "w"):
-            pass
-
-        self.repo.stage(["to_modify", "to_delete", "to_add"])
-
-        second_commit = self.repo.do_commit(b"The second commit")
-
-        # Get the patch
-        first_tree = self.repo[first_commit].tree
-        second_tree = self.repo[second_commit].tree
-
-        outstream = BytesIO()
-        porcelain.diff_tree(self.repo.path, first_tree, second_tree,
-                            outstream=outstream)
-
-        # Save it on disk
-        patch_path = os.path.join(self.test_dir, "patch.patch")
-        with open(patch_path, "wb") as patch:
-            patch.write(outstream.getvalue())
-
-        # And try to apply it to the copy directory
-        git_command = ["-C", copy_path, "apply", patch_path]
-        run_git_or_fail(git_command)
-
-        # And now check that the files contents are exactly the same between
-        # the two repositories
-        original_files = set(os.listdir(self.repo_path))
-        new_files = set(os.listdir(copy_path))
-
-        # Check that we have the exact same files in both repositories
-        assert original_files == new_files
-
-        for file in original_files:
-            if file == ".git":
-                continue
-
-            original_file_path = os.path.join(self.repo_path, file)
-            copy_file_path = os.path.join(copy_path, file)
-
-            assert os.path.isfile(copy_file_path)
-
-            with open(original_file_path, "rb") as original_file:
-                original_content = original_file.read()
-
-            with open(copy_file_path, "rb") as copy_file:
-                copy_content = copy_file.read()
-
-            assert original_content == copy_content
-
 
 class CommitTreeTests(PorcelainTestCase):
 

+ 1 - 1
setup.py

@@ -15,7 +15,7 @@ import io
 import os
 import sys
 
-dulwich_version_string = '0.19.12'
+dulwich_version_string = '0.19.13'
 
 include_dirs = []
 # Windows MSVC support