(repo_fn, v=None)
| 42 | return ''.join(curr) |
| 43 | |
| 44 | def print_log(repo_fn, v=None): |
| 45 | # Print log entries. *v* is a specific version number or None to print all. |
| 46 | currver = 0 |
| 47 | f = iter(open(repo_fn, 'r')) |
| 48 | line = next(f, '') |
| 49 | while line: |
| 50 | |
| 51 | # Process mandatory .V line and optional .N msg lines |
| 52 | assert line.startswith('.V') |
| 53 | repo_fn, datetime, msg = vline(line).groups() |
| 54 | for line in f: |
| 55 | if line.startswith('.N'): |
| 56 | msg += '\n' + nline(line).group(1) |
| 57 | else: |
| 58 | break |
| 59 | |
| 60 | currver += 1 |
| 61 | if v is None: |
| 62 | print "%s %d %18s %s" % (repo_fn, currver, datetime, msg) |
| 63 | elif currver == v: |
| 64 | print "%s %d %18s %s" % (repo_fn, currver, datetime, msg) |
| 65 | return |
| 66 | |
| 67 | # Skip through the .I and .C instructions |
| 68 | while line and line.startswith(('.I', '.C')): |
| 69 | if line.startswith('.I'): |
| 70 | n = int(iline(line).group(1)) |
| 71 | for line in islice(f, n): |
| 72 | pass |
| 73 | line = next(f, '') |
| 74 | |
| 75 | def diff(repo_fn, vnum1=None, vnum2=None, context=False): |
| 76 | # vnum1 or vnum2 can be None to indicate last version in repository |
no test coverage detected