Jelmer Vernooij 7 лет назад
Родитель
Сommit
9935d15a5d
5 измененных файлов с 9 добавлено и 27 удалено
  1. 5 4
      dulwich/annotate.py
  2. 2 1
      dulwich/fastexport.py
  3. 1 0
      dulwich/porcelain.py
  4. 1 0
      dulwich/tests/__init__.py
  5. 0 22
      dulwich/tests/test_annotate.py

+ 5 - 4
dulwich/annotate.py

@@ -28,7 +28,6 @@ Python's difflib.
 
 import difflib
 
-from dulwich.object_store import tree_lookup_path
 from dulwich.walk import (
     ORDER_DATE,
     Walker,
@@ -39,7 +38,8 @@ from dulwich.walk import (
 # When checking each revision, find lines that according to difflib.Differ()
 # are common between versions.
 # Any lines that are not in common were introduced by the newer revision.
-# If there were no lines kept from the older version, stop going deeper in the graph.
+# If there were no lines kept from the older version, stop going deeper in the
+# graph.
 
 def update_lines(annotated_lines, new_history_data, new_blob):
     """Update annotation lines with old blob lines.
@@ -61,7 +61,8 @@ def update_lines(annotated_lines, new_history_data, new_blob):
     return ret
 
 
-def annotate_lines(store, commit_id, path, order=ORDER_DATE, lines=None, follow=True):
+def annotate_lines(store, commit_id, path, order=ORDER_DATE, lines=None,
+                   follow=True):
     """Annotate the lines of a blob.
 
     :param store: Object store to retrieve objects from
@@ -74,7 +75,7 @@ def annotate_lines(store, commit_id, path, order=ORDER_DATE, lines=None, follow=
         commit is the oldest commit that changed a line
     """
     walker = Walker(store, include=[commit_id], paths=[path], order=order,
-        follow=follow)
+                    follow=follow)
     revs = []
     for log_entry in walker:
         for tree_change in log_entry.changes():

+ 2 - 1
dulwich/fastexport.py

@@ -46,7 +46,8 @@ import stat  # noqa: E402
 
 
 def split_email(text):
-    # TODO(jelmer): Dedupe this and the same functionality in format_annotate_line.
+    # TODO(jelmer): Dedupe this and the same functionality in
+    # format_annotate_line.
     (name, email) = text.rsplit(b" <", 1)
     return (name, email.rstrip(b">"))
 

+ 1 - 0
dulwich/porcelain.py

@@ -1150,4 +1150,5 @@ def annotate(repo, path, committish=None):
         commit_id = parse_commit(r, committish).id
         return annotate_lines(r.object_store, commit_id, path)
 
+
 blame = annotate

+ 1 - 0
dulwich/tests/__init__.py

@@ -98,6 +98,7 @@ class BlackboxTestCase(TestCase):
 
 def self_test_suite():
     names = [
+        'annotate',
         'archive',
         'blackbox',
         'client',

+ 0 - 22
dulwich/tests/test_annotate.py

@@ -17,25 +17,3 @@
 # MA  02110-1301, USA.
 
 """Tests for annotate support."""
-
-import tarfile
-
-from dulwich.archive import tar_stream
-from dulwich.object_store import (
-    MemoryObjectStore,
-    )
-from dulwich.objects import (
-    Blob,
-    Tree,
-    )
-from dulwich.tests import (
-    TestCase,
-    )
-from dulwich.tests.utils import (
-    build_commit_graph,
-    )
-
-
-class AnnotateTests(TestCase):
-
-    def test_onerev(self):