@@ -116,17 +116,20 @@ def tags(self):
116116 """
117117 return Tag .list_items (self )
118118
119- def blame (self , commit , file ):
119+ def blame (self , ref , file ):
120120 """
121- The blame information for the given file at the given commit
121+ The blame information for the given file at the given ref.
122+
123+ ``ref``
124+ Ref object or Commit
122125
123126 Returns
124127 list: [git.Commit, list: [<line>]]
125128 A list of tuples associating a Commit object with a list of lines that
126129 changed within the given commit. The Commit objects will be given in order
127130 of appearance.
128131 """
129- data = self .git .blame (commit , '--' , file , p = True )
132+ data = self .git .blame (ref , '--' , file , p = True )
130133 commits = {}
131134 blames = []
132135 info = None
@@ -196,17 +199,17 @@ def blame(self, commit, file):
196199 # END distinguish hexsha vs other information
197200 return blames
198201
199- def commits (self , start = None , path = '' , max_count = None , skip = 0 ):
202+ def commits (self , start = None , paths = '' , max_count = None , skip = 0 ):
200203 """
201204 A list of Commit objects representing the history of a given ref/commit
202205
203206 ``start``
204- is a ref to start the commits from. If start is None,
207+ is a Ref or Commit to start the commits from. If start is None,
205208 the active branch will be used
206209
207- ``path ``
208- is an optional path to limit the returned commits to
209- Commits that do not contain that path will not be returned.
210+ ``paths ``
211+ is an optional path or a list of paths to limit the returned commits to
212+ Commits that do not contain that path or the paths will not be returned.
210213
211214 ``max_count``
212215 is the maximum number of commits to return (default None)
@@ -225,63 +228,27 @@ def commits(self, start=None, path='', max_count=None, skip=0):
225228 options .pop ('max_count' )
226229 if start is None :
227230 start = self .active_branch
228- return Commit .list_items (self , start , path , ** options )
231+
232+ return Commit .list_items (self , start , paths , ** options )
229233
230- def commits_between (self , frm , to ):
234+ def commits_between (self , frm , to , * args , ** kwargs ):
231235 """
232236 The Commits objects that are reachable via ``to`` but not via ``frm``
233237 Commits are returned in chronological order.
234238
235239 ``from``
236- is the branch/commit name of the younger item
240+ is the Ref/Commit name of the younger item
237241
238242 ``to``
239- is the branch/commit name of the older item
243+ is the Ref/Commit name of the older item
240244
241245 Returns
242246 ``git.Commit[]``
243247 """
244248 return reversed (Commit .list_items (self , "%s..%s" % (frm , to )))
245249
246- def commits_since (self , start = 'master' , path = '' , since = '1970-01-01' ):
247- """
248- The Commits objects that are newer than the specified date.
249- Commits are returned in chronological order.
250-
251- ``start``
252- is the branch/commit name (default 'master')
253-
254- ``path``
255- is an optinal path to limit the returned commits to.
256-
257-
258- ``since``
259- is a string represeting a date/time
260-
261- Returns
262- ``git.Commit[]``
263- """
264- options = {'since' : since }
265-
266- return Commit .list_items (self , start , path , ** options )
267250
268- def commit_count (self , start = 'master' , path = '' ):
269- """
270- The number of commits reachable by the given branch/commit
271-
272- ``start``
273- is the branch/commit name (default 'master')
274-
275- ``path``
276- is an optional path
277- Commits that do not contain the path will not contribute to the count.
278-
279- Returns
280- ``int``
281- """
282- return Commit .count (self , start , path )
283-
284- def commit (self , id = None , path = '' ):
251+ def commit (self , id = None , paths = '' ):
285252 """
286253 The Commit object for the specified id
287254
@@ -290,8 +257,9 @@ def commit(self, id=None, path = ''):
290257 if None, it defaults to the active branch
291258
292259
293- ``path``
294- is an optional path, if set the returned commit must contain the path.
260+ ``paths``
261+ is an optional path or a list of paths,
262+ if set the returned commit must contain the path or paths
295263
296264 Returns
297265 ``git.Commit``
@@ -300,7 +268,7 @@ def commit(self, id=None, path = ''):
300268 id = self .active_branch
301269 options = {'max_count' : 1 }
302270
303- commits = Commit .list_items (self , id , path , ** options )
271+ commits = Commit .list_items (self , id , paths , ** options )
304272
305273 if not commits :
306274 raise ValueError , "Invalid identifier %s, or given path '%s' too restrictive" % ( id , path )
@@ -317,7 +285,7 @@ def commit_deltas_from(self, other_repo, ref='master', other_ref='master'):
317285 other_repo_refs = other_repo .git .rev_list (other_ref , '--' ).strip ().splitlines ()
318286
319287 diff_refs = list (set (other_repo_refs ) - set (repo_refs ))
320- return map (lambda ref : Commit . list_items (other_repo , ref , max_count = 1 )[ 0 ] , diff_refs )
288+ return map (lambda ref : Commit (other_repo , ref ) , diff_refs )
321289
322290 def tree (self , treeish = None ):
323291 """
0 commit comments