Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] EGit PDE - help with EGit/JGit

On Wed, Oct 27, 2010 at 2:42 PM, Paul Webster
<pwebster@xxxxxxxxxxxxxxxxxxx> wrote:
> From this I'm not sure how to find the last commit that changed the
> projects.  From the LogCommand I can get RevCommit and presumably the
> information I want is in RevTree?  Is there some way to turn a RevTree
> into a list of files/folders?

I see what you're trying to do now, something like this should work.

ObjectId start = repo.resolve(Constants.HEAD);
RevWalk walk = new RevWalk(repo).
walk.sort(RevSort.TOPO, true);
walk.sort(RevSort.COMMIT_TIME_DESC, true);
walk.setTreeFilter(PathFilter.create(mapping.getRepoRelativePath(file)));
walk.markStart(walk.lookupCommit(start));
RevCommit commit = walk.next();

If that doesn't work lmk, I haven't tested it.

-- 
Cheers,

Chris Aniszczyk
http://aniszczyk.org
+1 860 839 2465


Back to the top