aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage/vcs/git.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2010-02-08 17:05:12 -0500
committerW. Trevor King <wking@drexel.edu>2010-02-08 17:05:12 -0500
commit37d61e9ecd8768b25ba4aff3c657ccc56f086dd0 (patch)
tree31214efb9536a319473277610534cf2f37215ed1 /libbe/storage/vcs/git.py
parent3f27c5c3bbc1ecd00db51c4894a9bf9651ae4fbb (diff)
parent960565a8cc80f98d0a8bfa77029fbc78692ea1a1 (diff)
downloadbugseverywhere-37d61e9ecd8768b25ba4aff3c657ccc56f086dd0.tar.gz
Merged initial Sphinx documentation structure.
There's still a long way to go in this direction, but the basic framework is now in place. Toss in numpydoc-style docstrings http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines when you have time, and things will gradually improve over time. I also punted our user ID creation/parsing in libbe.ui.util.user to the email module. This way IDs are handled in an RFC-compliant way (less suprising for users) and by someone else (less work for us :).
Diffstat (limited to 'libbe/storage/vcs/git.py')
-rw-r--r--libbe/storage/vcs/git.py108
1 files changed, 57 insertions, 51 deletions
diff --git a/libbe/storage/vcs/git.py b/libbe/storage/vcs/git.py
index c6638bc..4df9bc8 100644
--- a/libbe/storage/vcs/git.py
+++ b/libbe/storage/vcs/git.py
@@ -17,8 +17,9 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-"""
-Git backend.
+"""Git_ backend.
+
+.. _Git: http://git-scm.com/
"""
import os
@@ -40,6 +41,8 @@ def new():
return Git()
class Git(base.VCS):
+ """:class:`base.VCS` implementation for Git.
+ """
name='git'
client='git'
@@ -179,55 +182,58 @@ class Git(base.VCS):
return output
def _parse_diff(self, diff_text):
- """
- Example diff text:
-
- diff --git a/dir/changed b/dir/changed
- index 6c3ea8c..2f2f7c7 100644
- --- a/dir/changed
- +++ b/dir/changed
- @@ -1,3 +1,3 @@
- hi
- -there
- +everyone and
- joe
- diff --git a/dir/deleted b/dir/deleted
- deleted file mode 100644
- index 225ec04..0000000
- --- a/dir/deleted
- +++ /dev/null
- @@ -1,3 +0,0 @@
- -in
- -the
- -beginning
- diff --git a/dir/moved b/dir/moved
- deleted file mode 100644
- index 5ef102f..0000000
- --- a/dir/moved
- +++ /dev/null
- @@ -1,4 +0,0 @@
- -the
- -ants
- -go
- -marching
- diff --git a/dir/moved2 b/dir/moved2
- new file mode 100644
- index 0000000..5ef102f
- --- /dev/null
- +++ b/dir/moved2
- @@ -0,0 +1,4 @@
- +the
- +ants
- +go
- +marching
- diff --git a/dir/new b/dir/new
- new file mode 100644
- index 0000000..94954ab
- --- /dev/null
- +++ b/dir/new
- @@ -0,0 +1,2 @@
- +hello
- +world
+ """_parse_diff(diff_text) -> (new,modified,removed)
+
+ `new`, `modified`, and `removed` are lists of files.
+
+ Example diff text::
+
+ diff --git a/dir/changed b/dir/changed
+ index 6c3ea8c..2f2f7c7 100644
+ --- a/dir/changed
+ +++ b/dir/changed
+ @@ -1,3 +1,3 @@
+ hi
+ -there
+ +everyone and
+ joe
+ diff --git a/dir/deleted b/dir/deleted
+ deleted file mode 100644
+ index 225ec04..0000000
+ --- a/dir/deleted
+ +++ /dev/null
+ @@ -1,3 +0,0 @@
+ -in
+ -the
+ -beginning
+ diff --git a/dir/moved b/dir/moved
+ deleted file mode 100644
+ index 5ef102f..0000000
+ --- a/dir/moved
+ +++ /dev/null
+ @@ -1,4 +0,0 @@
+ -the
+ -ants
+ -go
+ -marching
+ diff --git a/dir/moved2 b/dir/moved2
+ new file mode 100644
+ index 0000000..5ef102f
+ --- /dev/null
+ +++ b/dir/moved2
+ @@ -0,0 +1,4 @@
+ +the
+ +ants
+ +go
+ +marching
+ diff --git a/dir/new b/dir/new
+ new file mode 100644
+ index 0000000..94954ab
+ --- /dev/null
+ +++ b/dir/new
+ @@ -0,0 +1,2 @@
+ +hello
+ +world
"""
new = []
modified = []