Browse Source

New upstream version 0.16.3

Jelmer Vernooij 8 years ago
parent
commit
50ad4d8af7
9 changed files with 32 additions and 10 deletions
  1. 8 0
      .travis.yml
  2. 7 0
      NEWS
  3. 1 1
      PKG-INFO
  4. 1 1
      dulwich.egg-info/PKG-INFO
  5. 1 1
      dulwich/__init__.py
  6. 7 4
      dulwich/index.py
  7. 2 1
      dulwich/tests/test_index.py
  8. 1 1
      setup.py
  9. 4 1
      tox.ini

+ 8 - 0
.travis.yml

@@ -12,6 +12,14 @@ matrix:
       env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
     - python: "3.5"
       env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
+    - python: "3.5-dev"
+      env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
+    - python: "3.6"
+      env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
+    - python: "3.6-dev"
+      env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
+    - python: "3.7-dev"
+      env: TEST_REQUIRE="gevent greenlet geventhttpclient fastimport"
 cache:
   directories:
     - $HOME/.cache/pip

+ 7 - 0
NEWS

@@ -1,3 +1,10 @@
+0.16.3	2016-01-14
+
+ TEST FIXES
+
+  * Remove racy check that relies on clock time changing between writes.
+   (Jelmer Vernooij)
+
 0.16.2	2016-01-14
 
  IMPROVEMENTS

+ 1 - 1
PKG-INFO

@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: dulwich
-Version: 0.16.2
+Version: 0.16.3
 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: 1.1
 Name: dulwich
-Version: 0.16.2
+Version: 0.16.3
 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, 16, 2)
+__version__ = (0, 16, 3)

+ 7 - 4
dulwich/index.py

@@ -421,9 +421,10 @@ def build_file_from_blob(blob, mode, target_path, honor_filemode=True):
     :param target_path: Path to write to
     :param honor_filemode: An optional flag to honor core.filemode setting in
         config file, default is core.filemode=True, change executable bit
+    :return: stat object for the file
     """
     try:
-        oldstat = os.stat(target_path)
+        oldstat = os.lstat(target_path)
     except OSError as e:
         if e.errno == errno.ENOENT:
             oldstat = None
@@ -439,7 +440,7 @@ def build_file_from_blob(blob, mode, target_path, honor_filemode=True):
         if oldstat is not None and oldstat.st_size == len(contents):
             with open(target_path, 'rb') as f:
                 if f.read() == contents:
-                    return
+                    return oldstat
 
         with open(target_path, 'wb') as f:
             # Write out file
@@ -448,6 +449,8 @@ def build_file_from_blob(blob, mode, target_path, honor_filemode=True):
         if honor_filemode:
             os.chmod(target_path, mode)
 
+    return os.lstat(target_path)
+
 
 INVALID_DOTNAMES = (b".git", b".", b"..", b"")
 
@@ -508,12 +511,12 @@ def build_index_from_tree(root_path, index_path, object_store, tree_id,
         # FIXME: Merge new index into working tree
         if S_ISGITLINK(entry.mode):
             os.mkdir(full_path)
+            st = os.lstat(full_path)
         else:
             obj = object_store[entry.sha]
-            build_file_from_blob(obj, entry.mode, full_path,
+            st = build_file_from_blob(obj, entry.mode, full_path,
                 honor_filemode=honor_filemode)
         # Add file to index
-        st = os.lstat(full_path)
         if not honor_filemode or S_ISGITLINK(entry.mode):
             # we can not use tuple slicing to build a new tuple,
             # because on windows that will convert the times to

+ 2 - 1
dulwich/tests/test_index.py

@@ -405,7 +405,8 @@ class BuildIndexTests(TestCase):
             build_index_from_tree(repo.path, repo.index_path(),
                                   repo.object_store, tree.id)
             sync()
-            self.assertNotEqual(mtime, os.stat(filea_path).st_mtime)
+            with open(filea_path, 'rb') as fh:
+                self.assertEqual(b'file a', fh.read())
 
 
     @skipIf(not getattr(os, 'symlink', None), 'Requires symlink support')

+ 1 - 1
setup.py

@@ -9,7 +9,7 @@ except ImportError:
     from distutils.core import setup, Extension
 from distutils.core import Distribution
 
-dulwich_version_string = '0.16.2'
+dulwich_version_string = '0.16.3'
 
 include_dirs = []
 # Windows MSVC support

+ 4 - 1
tox.ini

@@ -1,6 +1,6 @@
 [tox]
 downloadcache = {toxworkdir}/cache/
-envlist = py27, pypy, py27-noext, pypy-noext, py34, py34-noext, py35, py35-noext
+envlist = py27, pypy, py27-noext, pypy-noext, py34, py34-noext, py35, py35-noext, py36, py36-noext
 
 [testenv]
 
@@ -19,3 +19,6 @@ commands = make check-noextensions
 
 [testenv:py35-noext]
 commands = make check-noextensions
+
+[testenv:py36-noext]
+commands = make check-noextensions