mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-18 10:07:28 +00:00
Include @ in the default revset
Yields a less confusing behavior of `jj log` after pushing a commit.
This commit is contained in:
parent
d188240939
commit
646fc338ab
5 changed files with 18 additions and 6 deletions
|
@ -82,7 +82,7 @@ impl UserSettings {
|
||||||
pub fn default_revset(&self) -> String {
|
pub fn default_revset(&self) -> String {
|
||||||
self.config
|
self.config
|
||||||
.get_string("ui.default-revset")
|
.get_string("ui.default-revset")
|
||||||
.unwrap_or_else(|_| "remote_branches().. | (remote_branches()..)-".to_string())
|
.unwrap_or_else(|_| "@ | remote_branches().. | (remote_branches()..)-".to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn signature(&self) -> Signature {
|
pub fn signature(&self) -> Signature {
|
||||||
|
|
|
@ -259,7 +259,7 @@ struct StatusArgs {}
|
||||||
#[derive(clap::Args, Clone, Debug)]
|
#[derive(clap::Args, Clone, Debug)]
|
||||||
struct LogArgs {
|
struct LogArgs {
|
||||||
/// Which revisions to show. Defaults to the `ui.default-revset` setting,
|
/// Which revisions to show. Defaults to the `ui.default-revset` setting,
|
||||||
/// or "remote_branches().. | (remote_branches()..)-" if it is not set.
|
/// or "@ | remote_branches().. | (remote_branches()..)-" if it is not set.
|
||||||
#[arg(long, short)]
|
#[arg(long, short)]
|
||||||
revisions: Option<String>,
|
revisions: Option<String>,
|
||||||
/// Show commits modifying the given paths
|
/// Show commits modifying the given paths
|
||||||
|
|
|
@ -101,7 +101,7 @@ fn test_alias_global_args_before_and_after() {
|
||||||
let repo_path = test_env.env_root().join("repo");
|
let repo_path = test_env.env_root().join("repo");
|
||||||
test_env.add_config(
|
test_env.add_config(
|
||||||
br#"[alias]
|
br#"[alias]
|
||||||
l = ["log", "-T", "commit_id"]
|
l = ["log", "-T", "commit_id", "-r", "all()"]
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
// Test the setup
|
// Test the setup
|
||||||
|
@ -140,7 +140,7 @@ fn test_alias_global_args_in_definition() {
|
||||||
let repo_path = test_env.env_root().join("repo");
|
let repo_path = test_env.env_root().join("repo");
|
||||||
test_env.add_config(
|
test_env.add_config(
|
||||||
br#"[alias]
|
br#"[alias]
|
||||||
l = ["log", "-T", "commit_id", "--at-op", "@-"]
|
l = ["log", "-T", "commit_id", "--at-op", "@-", "-r", "all()"]
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,10 @@ fn test_op_log() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_log_output(test_env: &TestEnvironment, repo_path: &Path, op_id: &str) -> String {
|
fn get_log_output(test_env: &TestEnvironment, repo_path: &Path, op_id: &str) -> String {
|
||||||
test_env.jj_cmd_success(repo_path, &["log", "-T", "commit_id", "--at-op", op_id])
|
test_env.jj_cmd_success(
|
||||||
|
repo_path,
|
||||||
|
&["log", "-T", "commit_id", "--at-op", op_id, "-r", "all()"],
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn redact_op_log(stdout: &str) -> String {
|
fn redact_op_log(stdout: &str) -> String {
|
||||||
|
|
|
@ -198,5 +198,14 @@ fn test_workspaces_forget() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_log_output(test_env: &TestEnvironment, cwd: &Path) -> String {
|
fn get_log_output(test_env: &TestEnvironment, cwd: &Path) -> String {
|
||||||
test_env.jj_cmd_success(cwd, &["log", "-T", r#"commit_id " " working_copies"#])
|
test_env.jj_cmd_success(
|
||||||
|
cwd,
|
||||||
|
&[
|
||||||
|
"log",
|
||||||
|
"-T",
|
||||||
|
r#"commit_id " " working_copies"#,
|
||||||
|
"-r",
|
||||||
|
"all()",
|
||||||
|
],
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue