mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-24 08:31:11 +00:00
cli: add support for restricting jj files
by paths
This commit is contained in:
parent
dabfd04da6
commit
68710366b4
@ -857,7 +857,8 @@ fn get_app<'help>() -> App<'help> {
|
|||||||
.arg(paths_arg());
|
.arg(paths_arg());
|
||||||
let files_command = App::new("files")
|
let files_command = App::new("files")
|
||||||
.about("List files in a revision")
|
.about("List files in a revision")
|
||||||
.arg(rev_arg().help("The revision to list files in"));
|
.arg(rev_arg().help("The revision to list files in"))
|
||||||
|
.arg(paths_arg());
|
||||||
let diff_command = App::new("diff")
|
let diff_command = App::new("diff")
|
||||||
.about("Show changes in a revision")
|
.about("Show changes in a revision")
|
||||||
.long_about(
|
.long_about(
|
||||||
@ -1800,7 +1801,12 @@ fn cmd_untrack(
|
|||||||
fn cmd_files(ui: &mut Ui, command: &CommandHelper, args: &ArgMatches) -> Result<(), CommandError> {
|
fn cmd_files(ui: &mut Ui, command: &CommandHelper, args: &ArgMatches) -> Result<(), CommandError> {
|
||||||
let mut workspace_command = command.workspace_helper(ui)?;
|
let mut workspace_command = command.workspace_helper(ui)?;
|
||||||
let commit = workspace_command.resolve_revision_arg(ui, args)?;
|
let commit = workspace_command.resolve_revision_arg(ui, args)?;
|
||||||
for (name, _value) in commit.tree().entries() {
|
let matcher = matcher_from_values(
|
||||||
|
ui,
|
||||||
|
workspace_command.workspace_root(),
|
||||||
|
args.values_of("paths"),
|
||||||
|
)?;
|
||||||
|
for (name, _value) in commit.tree().entries_matching(matcher.as_ref()) {
|
||||||
writeln!(
|
writeln!(
|
||||||
ui,
|
ui,
|
||||||
"{}",
|
"{}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user