summaryrefslogtreecommitdiff
path: root/lib/git
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git')
-rw-r--r--lib/git/actor.py2
-rw-r--r--lib/git/diff.py2
-rw-r--r--lib/git/objects/commit.py12
-rw-r--r--lib/git/objects/tree.py4
-rw-r--r--lib/git/refs.py8
-rw-r--r--lib/git/repo.py6
-rw-r--r--lib/git/stats.py2
7 files changed, 18 insertions, 18 deletions
diff --git a/lib/git/actor.py b/lib/git/actor.py
index f1aeda9b..fe4a47e5 100644
--- a/lib/git/actor.py
+++ b/lib/git/actor.py
@@ -25,7 +25,7 @@ class Actor(object):
return '<git.Actor "%s <%s>">' % (self.name, self.email)
@classmethod
- def from_string(cls, string):
+ def _from_string(cls, string):
"""
Create an Actor from a string.
diff --git a/lib/git/diff.py b/lib/git/diff.py
index 4bc88bf4..0db83b4f 100644
--- a/lib/git/diff.py
+++ b/lib/git/diff.py
@@ -74,7 +74,7 @@ class Diff(object):
self.diff = diff
@classmethod
- def list_from_string(cls, repo, text):
+ def _list_from_string(cls, repo, text):
"""
Create a new diff object from the given text
``repo``
diff --git a/lib/git/objects/commit.py b/lib/git/objects/commit.py
index c70b03e4..c3e97bf9 100644
--- a/lib/git/objects/commit.py
+++ b/lib/git/objects/commit.py
@@ -146,10 +146,10 @@ class Commit(base.Object):
options.update(kwargs)
output = repo.git.rev_list(ref, '--', path, **options)
- return cls.list_from_string(repo, output)
+ return cls._list_from_string(repo, output)
@classmethod
- def list_from_string(cls, repo, text):
+ def _list_from_string(cls, repo, text):
"""
Parse out commit information into a list of Commit objects
@@ -228,7 +228,7 @@ class Commit(base.Object):
paths.insert(0, b)
paths.insert(0, a)
text = repo.git.diff('-M', full_index=True, *paths)
- return diff.Diff.list_from_string(repo, text)
+ return diff.Diff._list_from_string(repo, text)
@property
def diffs(self):
@@ -240,7 +240,7 @@ class Commit(base.Object):
"""
if not self.parents:
d = self.repo.git.show(self.id, '-M', full_index=True, pretty='raw')
- return diff.Diff.list_from_string(self.repo, d)
+ return diff.Diff._list_from_string(self.repo, d)
else:
return self.diff(self.repo, self.parents[0].id, self.id)
@@ -262,7 +262,7 @@ class Commit(base.Object):
text = text2
else:
text = self.repo.git.diff(self.parents[0].id, self.id, '--', numstat=True)
- return stats.Stats.list_from_string(self.repo, text)
+ return stats.Stats._list_from_string(self.repo, text)
def __str__(self):
""" Convert commit to string which is SHA1 """
@@ -281,4 +281,4 @@ class Commit(base.Object):
"""
m = cls.re_actor_epoch.search(line)
actor, epoch = m.groups()
- return (Actor.from_string(actor), time.gmtime(int(epoch)))
+ return (Actor._from_string(actor), time.gmtime(int(epoch)))
diff --git a/lib/git/objects/tree.py b/lib/git/objects/tree.py
index 597668ae..273384a3 100644
--- a/lib/git/objects/tree.py
+++ b/lib/git/objects/tree.py
@@ -21,14 +21,14 @@ class Tree(base.IndexObject):
# Read the tree contents.
self._contents = {}
for line in self.repo.git.ls_tree(self.id).splitlines():
- obj = self.content_from_string(self.repo, line)
+ obj = self.content__from_string(self.repo, line)
if obj is not None:
self._contents[obj.path] = obj
else:
super(Tree, self)._set_cache_(attr)
@staticmethod
- def content_from_string(repo, text):
+ def content__from_string(repo, text):
"""
Parse a content item and create the appropriate object
diff --git a/lib/git/refs.py b/lib/git/refs.py
index cb730edb..820150d3 100644
--- a/lib/git/refs.py
+++ b/lib/git/refs.py
@@ -88,10 +88,10 @@ class Ref(object):
options.update(kwargs)
output = repo.git.for_each_ref(common_path, **options)
- return cls.list_from_string(repo, output)
+ return cls._list_from_string(repo, output)
@classmethod
- def list_from_string(cls, repo, text):
+ def _list_from_string(cls, repo, text):
"""
Parse out ref information into a list of Ref compatible objects
@@ -108,12 +108,12 @@ class Ref(object):
heads = []
for line in text.splitlines():
- heads.append(cls.from_string(repo, line))
+ heads.append(cls._from_string(repo, line))
return heads
@classmethod
- def from_string(cls, repo, line):
+ def _from_string(cls, repo, line):
"""
Create a new Ref instance from the given string.
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 6e23dbc6..dd5acfc3 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -179,9 +179,9 @@ class Repo(object):
c = commits.get(sha)
if c is None:
c = Commit( self, id=sha,
- author=Actor.from_string(info['author'] + ' ' + info['author_email']),
+ author=Actor._from_string(info['author'] + ' ' + info['author_email']),
authored_date=info['author_date'],
- committer=Actor.from_string(info['committer'] + ' ' + info['committer_email']),
+ committer=Actor._from_string(info['committer'] + ' ' + info['committer_email']),
committed_date=info['committer_date'],
message=info['summary'])
commits[sha] = c
@@ -357,7 +357,7 @@ class Repo(object):
if path:
arg.append(path)
commits = self.git.log(*arg, **options)
- return Commit.list_from_string(self, commits)
+ return Commit._list_from_string(self, commits)
def diff(self, a, b, *paths):
"""
diff --git a/lib/git/stats.py b/lib/git/stats.py
index 19b1591f..bda4e539 100644
--- a/lib/git/stats.py
+++ b/lib/git/stats.py
@@ -38,7 +38,7 @@ class Stats(object):
self.files = files
@classmethod
- def list_from_string(cls, repo, text):
+ def _list_from_string(cls, repo, text):
"""
Create a Stat object from output retrieved by git-diff.