mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
git: support '{files}' template
Summary: Change `ctx.files()` to run diff for git repos. This would make a few revsets and templates working. Reviewed By: danielocfb Differential Revision: D33354722 fbshipit-source-id: c6449d7f405f2d2c568294eeebe47d371e46cb12
This commit is contained in:
parent
471b5a49a4
commit
484e37311e
@ -25,6 +25,7 @@ from . import (
|
||||
error,
|
||||
extensions,
|
||||
fileset,
|
||||
git,
|
||||
match as matchmod,
|
||||
mdiff,
|
||||
mutation,
|
||||
@ -576,7 +577,11 @@ class changectx(basectx):
|
||||
return self._changeset.date
|
||||
|
||||
def files(self):
|
||||
return self._changeset.files
|
||||
files = self._changeset.files
|
||||
# git does not provide "files" in commit message - run diff to get it
|
||||
if not files and git.isgit(self._repo):
|
||||
files = sorted(self.manifest().diff(self.p1().manifest()).keys())
|
||||
return files
|
||||
|
||||
def description(self):
|
||||
return self._changeset.description
|
||||
|
@ -289,3 +289,8 @@ Test push:
|
||||
abort: use '--to' to specify destination bookmark
|
||||
[255]
|
||||
|
||||
"files" metadata:
|
||||
|
||||
$ hg log -r $A+$B -T '{files}\n'
|
||||
A
|
||||
B
|
||||
|
Loading…
Reference in New Issue
Block a user