Show More
@@ -370,6 +370,29 b' def descendants(repo, subset, x):' | |||||
370 | s = set(repo.changelog.descendants(*args)) | set(args) |
|
370 | s = set(repo.changelog.descendants(*args)) | set(args) | |
371 | return [r for r in subset if r in s] |
|
371 | return [r for r in subset if r in s] | |
372 |
|
372 | |||
|
373 | def filelog(repo, subset, x): | |||
|
374 | """``filelog(pattern)`` | |||
|
375 | Changesets connected to the specified filelog. | |||
|
376 | """ | |||
|
377 | ||||
|
378 | pat = getstring(x, _("filelog requires a pattern")) | |||
|
379 | m = matchmod.match(repo.root, repo.getcwd(), [pat], default='relpath') | |||
|
380 | s = set() | |||
|
381 | ||||
|
382 | if not m.anypats(): | |||
|
383 | for f in m.files(): | |||
|
384 | fl = repo.file(f) | |||
|
385 | for fr in fl: | |||
|
386 | s.add(fl.linkrev(fr)) | |||
|
387 | else: | |||
|
388 | for f in repo[None]: | |||
|
389 | if m(f): | |||
|
390 | fl = repo.file(f) | |||
|
391 | for fr in fl: | |||
|
392 | s.add(fl.linkrev(fr)) | |||
|
393 | ||||
|
394 | return [r for r in subset if r in s] | |||
|
395 | ||||
373 | def follow(repo, subset, x): |
|
396 | def follow(repo, subset, x): | |
374 | """``follow()`` |
|
397 | """``follow()`` | |
375 | An alias for ``::.`` (ancestors of the working copy's first parent). |
|
398 | An alias for ``::.`` (ancestors of the working copy's first parent). | |
@@ -780,6 +803,7 b' symbols = {' | |||||
780 | "date": date, |
|
803 | "date": date, | |
781 | "descendants": descendants, |
|
804 | "descendants": descendants, | |
782 | "file": hasfile, |
|
805 | "file": hasfile, | |
|
806 | "filelog": filelog, | |||
783 | "follow": follow, |
|
807 | "follow": follow, | |
784 | "grep": grep, |
|
808 | "grep": grep, | |
785 | "head": head, |
|
809 | "head": head, |
General Comments 0
You need to be logged in to leave comments.
Login now