diff options
-rw-r--r-- | doc/tutorial.txt | 38 | ||||
-rw-r--r-- | lib/git/actor.py | 2 | ||||
-rw-r--r-- | lib/git/blob.py | 6 | ||||
-rw-r--r-- | lib/git/commit.py | 10 | ||||
-rw-r--r-- | lib/git/head.py | 12 | ||||
-rw-r--r-- | lib/git/repo.py | 32 | ||||
-rw-r--r-- | lib/git/tag.py | 10 | ||||
-rw-r--r-- | lib/git/tree.py | 10 | ||||
-rw-r--r-- | test/git/test_actor.py | 2 | ||||
-rw-r--r-- | test/git/test_blob.py | 2 | ||||
-rw-r--r-- | test/git/test_commit.py | 2 | ||||
-rw-r--r-- | test/git/test_head.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 2 | ||||
-rw-r--r-- | test/git/test_tag.py | 2 | ||||
-rw-r--r-- | test/git/test_tree.py | 2 |
15 files changed, 67 insertions, 67 deletions
diff --git a/doc/tutorial.txt b/doc/tutorial.txt index 42e015b6..26cdf1af 100644 --- a/doc/tutorial.txt +++ b/doc/tutorial.txt @@ -27,10 +27,10 @@ From the ``Repo`` object, you can get a list of ``Commit`` objects. >>> repo.commits() - [<GitPython.Commit "207c0c4418115df0d30820ab1a9acd2ea4bf4431">, - <GitPython.Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">, - <GitPython.Commit "e17c7e11aed9e94d2159e549a99b966912ce1091">, - <GitPython.Commit "bd795df2d0e07d10e0298670005c0e9d9a5ed867">] + [<git.Commit "207c0c4418115df0d30820ab1a9acd2ea4bf4431">, + <git.Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">, + <git.Commit "e17c7e11aed9e94d2159e549a99b966912ce1091">, + <git.Commit "bd795df2d0e07d10e0298670005c0e9d9a5ed867">] Called without arguments, ``Repo.commits`` returns a list of up to ten commits reachable by the master branch (starting at the latest commit). You can ask @@ -61,19 +61,19 @@ Commit objects contain information about a specific commit. '207c0c4418115df0d30820ab1a9acd2ea4bf4431' >>> head.parents - [<GitPython.Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">] + [<git.Commit "a91c45eee0b41bf3cdaad3418ca3850664c4a4b4">] >>> head.tree - <GitPython.Tree "563413aedbeda425d8d9dcbb744247d0c3e8a0ac"> + <git.Tree "563413aedbeda425d8d9dcbb744247d0c3e8a0ac"> >>> head.author - <GitPython.Actor "Michael Trier <mtrier@gmail.com>"> + <git.Actor "Michael Trier <mtrier@gmail.com>"> >>> head.authored_date (2008, 5, 7, 5, 0, 56, 2, 128, 0) >>> head.committer - <GitPython.Actor "Michael Trier <mtrier@gmail.com>"> + <git.Actor "Michael Trier <mtrier@gmail.com>"> >>> head.committed_date (2008, 5, 7, 5, 0, 56, 2, 128, 0) @@ -107,7 +107,7 @@ A tree records pointers to the contents of a directory. Let's say you want the root tree of the latest commit on the master branch. >>> tree = repo.commits()[0].tree - <GitPython.Tree "a006b5b1a8115185a228b7514cdcd46fed90dc92"> + <git.Tree "a006b5b1a8115185a228b7514cdcd46fed90dc92"> >>> tree.id 'a006b5b1a8115185a228b7514cdcd46fed90dc92' @@ -115,17 +115,17 @@ the root tree of the latest commit on the master branch. Once you have a tree, you can get the contents. >>> contents = tree.contents - [<GitPython.Blob "6a91a439ea968bf2f5ce8bb1cd8ddf5bf2cad6c7">, - <GitPython.Blob "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391">, - <GitPython.Tree "eaa0090ec96b054e425603480519e7cf587adfc3">, - <GitPython.Blob "980e72ae16b5378009ba5dfd6772b59fe7ccd2df">] + [<git.Blob "6a91a439ea968bf2f5ce8bb1cd8ddf5bf2cad6c7">, + <git.Blob "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391">, + <git.Tree "eaa0090ec96b054e425603480519e7cf587adfc3">, + <git.Blob "980e72ae16b5378009ba5dfd6772b59fe7ccd2df">] This tree contains three ``Blob`` objects and one ``Tree`` object. The trees are subdirectories and the blobs are files. Trees below the root have additional attributes. >>> contents = tree["lib"] - <GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a3"> + <git.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a3"> >>> contents.name 'test' @@ -138,15 +138,15 @@ from a tree with a syntax similar to how paths are written in an unix system. >>> tree/"lib" - <GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30"> + <git.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30"> You can also get a tree directly from the repository if you know its name. >>> repo.tree() - <GitPython.Tree "master"> + <git.Tree "master"> >>> repo.tree("c1c7214dde86f76bc3e18806ac1f47c38b2b7a30") - <GitPython.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30"> + <git.Tree "c1c7214dde86f76bc3e18806ac1f47c38b2b7a30"> The Blob object *************** @@ -154,7 +154,7 @@ The Blob object A blob represents a file. Trees often contain blobs. >>> blob = tree.contents[-1] - <GitPython.Blob "b19574431a073333ea09346eafd64e7b1908ef49"> + <git.Blob "b19574431a073333ea09346eafd64e7b1908ef49"> A blob has certain attributes. @@ -178,7 +178,7 @@ You can get the data of a blob as a string. You can also get a blob directly from the repo if you know its name. >>> repo.blob("b19574431a073333ea09346eafd64e7b1908ef49") - <GitPython.Blob "b19574431a073333ea09346eafd64e7b1908ef49"> + <git.Blob "b19574431a073333ea09346eafd64e7b1908ef49"> What Else? ********** diff --git a/lib/git/actor.py b/lib/git/actor.py index afd94016..901e52af 100644 --- a/lib/git/actor.py +++ b/lib/git/actor.py @@ -15,7 +15,7 @@ class Actor(object): return self.name def __repr__(self): - return '<GitPython.Actor "%s <%s>">' % (self.name, self.email) + return '<git.Actor "%s <%s>">' % (self.name, self.email) @classmethod def from_string(cls, string): diff --git a/lib/git/blob.py b/lib/git/blob.py index 80d237d7..a79cd81c 100644 --- a/lib/git/blob.py +++ b/lib/git/blob.py @@ -31,7 +31,7 @@ class Blob(object): is the file name Returns - GitPython.Blob + git.Blob """ self.repo = repo self.id = id @@ -87,7 +87,7 @@ class Blob(object): The blame information for the given file at the given commit Returns - list: [GitPython.Commit, list: [<line>]] + list: [git.Commit, list: [<line>]] """ data = repo.git.blame(commit, '--', file, p=True) commits = {} @@ -141,4 +141,4 @@ class Blob(object): return blames def __repr__(self): - return '<GitPython.Blob "%s">' % self.id + return '<git.Blob "%s">' % self.id diff --git a/lib/git/commit.py b/lib/git/commit.py index e92293e4..8b7bdfa8 100644 --- a/lib/git/commit.py +++ b/lib/git/commit.py @@ -47,7 +47,7 @@ class Commit(LazyMixin): is the list of the parents of the commit Returns - GitPython.Commit + git.Commit """ LazyMixin.__init__(self) @@ -113,7 +113,7 @@ class Commit(LazyMixin): ``skip`` is the number of commits to skip Returns - GitPython.Commit[] + git.Commit[] """ options = {'pretty': 'raw'} options.update(kwargs) @@ -133,7 +133,7 @@ class Commit(LazyMixin): is the text output from the git command (raw format) Returns - GitPython.Commit[] + git.Commit[] """ lines = [l for l in text.splitlines() if l.strip()] @@ -180,7 +180,7 @@ class Commit(LazyMixin): is a list of paths to limit the diff. Returns - GitPython.Diff[] + git.Diff[] """ paths = paths or [] @@ -229,7 +229,7 @@ class Commit(LazyMixin): return self.id def __repr__(self): - return '<GitPython.Commit "%s">' % self.id + return '<git.Commit "%s">' % self.id @classmethod def actor(cls, line): diff --git a/lib/git/head.py b/lib/git/head.py index 96d35010..4386aa98 100644 --- a/lib/git/head.py +++ b/lib/git/head.py @@ -20,7 +20,7 @@ class Head(object): 'master' >>> head.commit - <GitPython.Commit "1c09f116cbc2cb4100fb6935bb162daa4723f455"> + <git.Commit "1c09f116cbc2cb4100fb6935bb162daa4723f455"> >>> head.commit.id '1c09f116cbc2cb4100fb6935bb162daa4723f455' @@ -37,7 +37,7 @@ class Head(object): is the Commit that the head points to Returns - GitPython.Head + git.Head """ self.name = name self.commit = commit @@ -54,7 +54,7 @@ class Head(object): is a dict of options Returns - GitPython.Head[] + git.Head[] """ options = {'sort': "committerdate", @@ -75,7 +75,7 @@ class Head(object): is the text output from the git command Returns - GitPython.Head[] + git.Head[] """ heads = [] @@ -101,7 +101,7 @@ class Head(object): id: [0-9A-Fa-f]{40} Returns - GitPython.Head + git.Head """ full_name, ids = line.split("\x00") name = full_name.split("/")[-1] @@ -109,4 +109,4 @@ class Head(object): return Head(name, c) def __repr__(self): - return '<GitPython.Head "%s">' % self.name + return '<git.Head "%s">' % self.name diff --git a/lib/git/repo.py b/lib/git/repo.py index fdfb7928..a3874259 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -31,7 +31,7 @@ class Repo(object): repo = Repo("/Users/mtrier/Development/git-python.git") Returns - ``GitPython.Repo`` + ``git.Repo`` """ epath = os.path.abspath(os.path.expanduser(path or os.getcwd())) @@ -83,7 +83,7 @@ class Repo(object): this repo Returns - ``GitPython.Head[]`` + ``git.Head[]`` """ return Head.find_all(self) @@ -96,7 +96,7 @@ class Repo(object): A list of ``Tag`` objects that are available in this repo Returns - ``GitPython.Tag[]`` + ``git.Tag[]`` """ return Tag.find_all(self) @@ -114,7 +114,7 @@ class Repo(object): is the number of commits to skip (default 0) Returns - ``GitPython.Commit[]`` + ``git.Commit[]`` """ options = {'max_count': max_count, 'skip': skip} @@ -133,7 +133,7 @@ class Repo(object): is the branch/commit name of the older item Returns - ``GitPython.Commit[]`` + ``git.Commit[]`` """ return Commit.find_all(self, "%s..%s" % (frm, to)).reverse() @@ -149,7 +149,7 @@ class Repo(object): is a string represeting a date/time Returns - ``GitPython.Commit[]`` + ``git.Commit[]`` """ options = {'since': since} @@ -175,7 +175,7 @@ class Repo(object): is the SHA1 identifier of the commit Returns - GitPython.Commit + git.Commit """ options = {'max_count': 1} @@ -190,7 +190,7 @@ class Repo(object): Returns a list of commits that is in ``other_repo`` but not in self Returns - ``GitPython.Commit[]`` + ``git.Commit[]`` """ repo_refs = self.git.rev_list(ref).strip().splitlines() other_repo_refs = other_repo.git.rev_list(other_ref).strip().splitlines() @@ -211,7 +211,7 @@ class Repo(object): Returns - ``GitPython.Tree`` + ``git.Tree`` """ return Tree(self, id=treeish) @@ -223,7 +223,7 @@ class Repo(object): is the SHA1 id of the blob Returns - ``GitPython.Blob`` + ``git.Blob`` """ return Blob(self, id=id) @@ -232,7 +232,7 @@ class Repo(object): The commit log for a treeish Returns - ``GitPython.Commit[]`` + ``git.Commit[]`` """ options = {'pretty': 'raw'} options.update(kwargs) @@ -263,7 +263,7 @@ class Repo(object): ``commit`` is the commit name/id Returns - ``GitPython.Diff[]`` + ``git.Diff[]`` """ return Commit.diff(self, commit) @@ -284,10 +284,10 @@ class Repo(object): Examples:: - GitPython.Repo.init_bare('/var/git/myrepo.git') + git.Repo.init_bare('/var/git/myrepo.git') Returns - ``GitPython.Repo`` (the newly created repo) + ``git.Repo`` (the newly created repo) """ if mkdir and not os.path.exists(path): @@ -309,7 +309,7 @@ class Repo(object): is any additional options to the git clone command Returns - ``GitPython.Repo`` (the newly forked repo) + ``git.Repo`` (the newly forked repo) """ options = {'bare': True} options.update(kwargs) @@ -467,4 +467,4 @@ class Repo(object): return branch def __repr__(self): - return '<GitPython.Repo "%s">' % self.path + return '<git.Repo "%s">' % self.path diff --git a/lib/git/tag.py b/lib/git/tag.py index f54b7661..e780d2ba 100644 --- a/lib/git/tag.py +++ b/lib/git/tag.py @@ -18,7 +18,7 @@ class Tag(object): is the Commit that the head points to Returns - ``GitPython.Tag`` + ``git.Tag`` """ self.name = name self.commit = commit @@ -35,7 +35,7 @@ class Tag(object): is a dict of options Returns - ``GitPython.Tag[]`` + ``git.Tag[]`` """ options = {'sort': "committerdate", 'format': "%(refname)%00%(objectname)"} @@ -56,7 +56,7 @@ class Tag(object): is the text output from the git command Returns - ``GitPython.Tag[]`` + ``git.Tag[]`` """ tags = [] for line in text.splitlines(): @@ -80,7 +80,7 @@ class Tag(object): id: [0-9A-Fa-f]{40} Returns - ``GitPython.Tag`` + ``git.Tag`` """ full_name, ids = line.split("\x00") name = full_name.split("/")[-1] @@ -88,4 +88,4 @@ class Tag(object): return Tag(name, commit) def __repr__(self): - return '<GitPython.Tag "%s">' % self.name + return '<git.Tag "%s">' % self.name diff --git a/lib/git/tree.py b/lib/git/tree.py index dbd78ac4..d4587573 100644 --- a/lib/git/tree.py +++ b/lib/git/tree.py @@ -42,7 +42,7 @@ class Tree(LazyMixin): is the single line containing the items data in `git ls-tree` format Returns - ``GitPython.Blob`` or ``GitPython.Tree`` + ``git.Blob`` or ``git.Tree`` """ try: mode, typ, id, name = text.expandtabs(1).split(" ", 4) @@ -65,12 +65,12 @@ class Tree(LazyMixin): Examples:: >>> Repo('/path/to/python-git').tree/'lib' - <GitPython.Tree "6cc23ee138be09ff8c28b07162720018b244e95e"> + <git.Tree "6cc23ee138be09ff8c28b07162720018b244e95e"> >>> Repo('/path/to/python-git').tree/'README.txt' - <GitPython.Blob "8b1e02c0fb554eed2ce2ef737a68bb369d7527df"> + <git.Blob "8b1e02c0fb554eed2ce2ef737a68bb369d7527df"> Returns - ``GitPython.Blob`` or ``GitPython.Tree`` or ``None`` if not found + ``git.Blob`` or ``git.Tree`` or ``None`` if not found """ return self.get(file) @@ -79,7 +79,7 @@ class Tree(LazyMixin): os.path.basename(self.name) def __repr__(self): - return '<GitPython.Tree "%s">' % self.id + return '<git.Tree "%s">' % self.id # Implement the basics of the dict protocol: # directories/trees can be seen as object dicts. diff --git a/test/git/test_actor.py b/test/git/test_actor.py index 3bb92a09..76b0ecc9 100644 --- a/test/git/test_actor.py +++ b/test/git/test_actor.py @@ -21,7 +21,7 @@ class TestActor(object): def test_should_display_representation(self): a = Actor.from_string("Michael Trier <mtrier@example.com>") - assert_equal('<GitPython.Actor "Michael Trier <mtrier@example.com>">', repr(a)) + assert_equal('<git.Actor "Michael Trier <mtrier@example.com>">', repr(a)) def test_str_should_alias_name(self): a = Actor.from_string("Michael Trier <mtrier@example.com>") diff --git a/test/git/test_blob.py b/test/git/test_blob.py index c4d8036c..2f43e82f 100644 --- a/test/git/test_blob.py +++ b/test/git/test_blob.py @@ -86,4 +86,4 @@ class TestBlob(object): def test_should_return_appropriate_representation(self): blob = Blob(self.repo, **{'id': 'abc'}) - assert_equal('<GitPython.Blob "abc">', repr(blob)) + assert_equal('<git.Blob "abc">', repr(blob)) diff --git a/test/git/test_commit.py b/test/git/test_commit.py index ff7458e1..583a5079 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -218,4 +218,4 @@ class TestCommit(object): def test_repr(self): commit = Commit(self.repo, id='abc') - assert_equal('<GitPython.Commit "abc">', repr(commit)) + assert_equal('<git.Commit "abc">', repr(commit)) diff --git a/test/git/test_head.py b/test/git/test_head.py index d3af3d6b..ecac13c8 100644 --- a/test/git/test_head.py +++ b/test/git/test_head.py @@ -17,7 +17,7 @@ class TestHead(object): head = self.repo.heads[0] - assert_equal('<GitPython.Head "%s">' % head.name, repr(head)) + assert_equal('<git.Head "%s">' % head.name, repr(head)) assert_true(git.called) assert_equal(git.call_args, (('for_each_ref', 'refs/heads'), {'sort': 'committerdate', 'format': '%(refname)%00%(objectname)'})) diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 989dd4fe..669a8f62 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -256,7 +256,7 @@ class TestRepo(object): def test_repr(self): path = os.path.join(os.path.abspath(GIT_REPO), '.git') - assert_equal('<GitPython.Repo "%s">' % path, repr(self.repo)) + assert_equal('<git.Repo "%s">' % path, repr(self.repo)) @patch(Git, '_call_process') def test_log(self, git): diff --git a/test/git/test_tag.py b/test/git/test_tag.py index 2f915b8d..3d33d7e3 100644 --- a/test/git/test_tag.py +++ b/test/git/test_tag.py @@ -30,7 +30,7 @@ class TestTag(object): git.return_value = fixture('for_each_ref') tag = self.repo.tags[0] - assert_equal('<GitPython.Tag "%s">' % tag.name, repr(tag)) + assert_equal('<git.Tag "%s">' % tag.name, repr(tag)) assert_true(git.called) assert_equal(git.call_args, (('for_each_ref', 'refs/tags'), {'sort': 'committerdate', 'format': '%(refname)%00%(objectname)'})) diff --git a/test/git/test_tree.py b/test/git/test_tree.py index 34aa4d61..fa3337c9 100644 --- a/test/git/test_tree.py +++ b/test/git/test_tree.py @@ -146,4 +146,4 @@ class TestTree(object): def test_repr(self): tree = Tree(self.repo, id='abc') - assert_equal('<GitPython.Tree "abc">', repr(tree)) + assert_equal('<git.Tree "abc">', repr(tree)) |