ScottDuckworth / python-anyvcs

A Python abstraction layer for multiple version control systems
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

SvnRepo.log() always returns latest log entry with 'path=' argument #24

Closed OEP closed 10 years ago

OEP commented 10 years ago

A while ago back when I was looking log lookups the slow way, I noticed SVN actually gave me the latest revision for each file in the directory list. It seems like this issue still exists too, though it's less of an issue because the faster way works correctly.

Here's a quick script to demonstrate what I was doing:

import anyvcs
import sys

if len(sys.argv) not in (3, 4):
  print "Usage:", sys.argv[0], "repo rev [path]"
  sys.exit(1)

repo = sys.argv[1]
rev = sys.argv[2]
path = sys.argv[3] if len(sys.argv) == 4 else "/"

cl = anyvcs.open(repo)
for x in cl.ls(rev, path):
  msg = cl.log(limit=1, path=x.name)[0].subject
  print x.name, "--", msg

and example output on a repo with two files added on two different commits:

EXPECTED
==========
two -- add two
one -- add one

ACTUAL
==========
two -- add two
one -- add two