dulwich-users team mailing list archive
-
dulwich-users team
-
Mailing list archive
-
Message #00767
Re: retrieve the last revision id of a file
Hi Adrien,
On Wed, Jul 17, 2013 at 06:05:51PM +0200, Adrien Saladin wrote:
> I need to retrieve the last revision id of a given file (ie the
> equivalent of git log -n1 filename). But I can't find how to do this
> with dulwich.
You can use the graph walker to do this. See Repository.get_walker().
http://www.samba.org/~jelmer/dulwich/apidocs/dulwich.repo.BaseRepo.html#get_walker
Note that this will scan the history (just like "git log -n1" will) because
git does not explicitly store information about in what revision a file was
last changed.
Cheers,
Jelmer
Follow ups
References