##// END OF EJS Templates
rhg: support "!" syntax for disabling extensions...
Raphaël Gomès -
r50372:f3cd2d6e default
parent child Browse files
Show More
@@ -1,809 +1,814 b''
1 extern crate log;
1 extern crate log;
2 use crate::error::CommandError;
2 use crate::error::CommandError;
3 use crate::ui::{local_to_utf8, Ui};
3 use crate::ui::{local_to_utf8, Ui};
4 use clap::App;
4 use clap::App;
5 use clap::AppSettings;
5 use clap::AppSettings;
6 use clap::Arg;
6 use clap::Arg;
7 use clap::ArgMatches;
7 use clap::ArgMatches;
8 use format_bytes::{format_bytes, join};
8 use format_bytes::{format_bytes, join};
9 use hg::config::{Config, ConfigSource};
9 use hg::config::{Config, ConfigSource};
10 use hg::repo::{Repo, RepoError};
10 use hg::repo::{Repo, RepoError};
11 use hg::utils::files::{get_bytes_from_os_str, get_path_from_bytes};
11 use hg::utils::files::{get_bytes_from_os_str, get_path_from_bytes};
12 use hg::utils::SliceExt;
12 use hg::utils::SliceExt;
13 use hg::{exit_codes, requirements};
13 use hg::{exit_codes, requirements};
14 use std::collections::HashSet;
14 use std::collections::HashSet;
15 use std::ffi::OsString;
15 use std::ffi::OsString;
16 use std::os::unix::prelude::CommandExt;
16 use std::os::unix::prelude::CommandExt;
17 use std::path::PathBuf;
17 use std::path::PathBuf;
18 use std::process::Command;
18 use std::process::Command;
19
19
20 mod blackbox;
20 mod blackbox;
21 mod color;
21 mod color;
22 mod error;
22 mod error;
23 mod ui;
23 mod ui;
24 pub mod utils {
24 pub mod utils {
25 pub mod path_utils;
25 pub mod path_utils;
26 }
26 }
27
27
28 fn main_with_result(
28 fn main_with_result(
29 argv: Vec<OsString>,
29 argv: Vec<OsString>,
30 process_start_time: &blackbox::ProcessStartTime,
30 process_start_time: &blackbox::ProcessStartTime,
31 ui: &ui::Ui,
31 ui: &ui::Ui,
32 repo: Result<&Repo, &NoRepoInCwdError>,
32 repo: Result<&Repo, &NoRepoInCwdError>,
33 config: &Config,
33 config: &Config,
34 ) -> Result<(), CommandError> {
34 ) -> Result<(), CommandError> {
35 check_unsupported(config, repo)?;
35 check_unsupported(config, repo)?;
36
36
37 let app = App::new("rhg")
37 let app = App::new("rhg")
38 .global_setting(AppSettings::AllowInvalidUtf8)
38 .global_setting(AppSettings::AllowInvalidUtf8)
39 .global_setting(AppSettings::DisableVersion)
39 .global_setting(AppSettings::DisableVersion)
40 .setting(AppSettings::SubcommandRequired)
40 .setting(AppSettings::SubcommandRequired)
41 .setting(AppSettings::VersionlessSubcommands)
41 .setting(AppSettings::VersionlessSubcommands)
42 .arg(
42 .arg(
43 Arg::with_name("repository")
43 Arg::with_name("repository")
44 .help("repository root directory")
44 .help("repository root directory")
45 .short("-R")
45 .short("-R")
46 .long("--repository")
46 .long("--repository")
47 .value_name("REPO")
47 .value_name("REPO")
48 .takes_value(true)
48 .takes_value(true)
49 // Both ok: `hg -R ./foo log` or `hg log -R ./foo`
49 // Both ok: `hg -R ./foo log` or `hg log -R ./foo`
50 .global(true),
50 .global(true),
51 )
51 )
52 .arg(
52 .arg(
53 Arg::with_name("config")
53 Arg::with_name("config")
54 .help("set/override config option (use 'section.name=value')")
54 .help("set/override config option (use 'section.name=value')")
55 .long("--config")
55 .long("--config")
56 .value_name("CONFIG")
56 .value_name("CONFIG")
57 .takes_value(true)
57 .takes_value(true)
58 .global(true)
58 .global(true)
59 // Ok: `--config section.key1=val --config section.key2=val2`
59 // Ok: `--config section.key1=val --config section.key2=val2`
60 .multiple(true)
60 .multiple(true)
61 // Not ok: `--config section.key1=val section.key2=val2`
61 // Not ok: `--config section.key1=val section.key2=val2`
62 .number_of_values(1),
62 .number_of_values(1),
63 )
63 )
64 .arg(
64 .arg(
65 Arg::with_name("cwd")
65 Arg::with_name("cwd")
66 .help("change working directory")
66 .help("change working directory")
67 .long("--cwd")
67 .long("--cwd")
68 .value_name("DIR")
68 .value_name("DIR")
69 .takes_value(true)
69 .takes_value(true)
70 .global(true),
70 .global(true),
71 )
71 )
72 .arg(
72 .arg(
73 Arg::with_name("color")
73 Arg::with_name("color")
74 .help("when to colorize (boolean, always, auto, never, or debug)")
74 .help("when to colorize (boolean, always, auto, never, or debug)")
75 .long("--color")
75 .long("--color")
76 .value_name("TYPE")
76 .value_name("TYPE")
77 .takes_value(true)
77 .takes_value(true)
78 .global(true),
78 .global(true),
79 )
79 )
80 .version("0.0.1");
80 .version("0.0.1");
81 let app = add_subcommand_args(app);
81 let app = add_subcommand_args(app);
82
82
83 let matches = app.clone().get_matches_from_safe(argv.iter())?;
83 let matches = app.clone().get_matches_from_safe(argv.iter())?;
84
84
85 let (subcommand_name, subcommand_matches) = matches.subcommand();
85 let (subcommand_name, subcommand_matches) = matches.subcommand();
86
86
87 // Mercurial allows users to define "defaults" for commands, fallback
87 // Mercurial allows users to define "defaults" for commands, fallback
88 // if a default is detected for the current command
88 // if a default is detected for the current command
89 let defaults = config.get_str(b"defaults", subcommand_name.as_bytes());
89 let defaults = config.get_str(b"defaults", subcommand_name.as_bytes());
90 if defaults?.is_some() {
90 if defaults?.is_some() {
91 let msg = "`defaults` config set";
91 let msg = "`defaults` config set";
92 return Err(CommandError::unsupported(msg));
92 return Err(CommandError::unsupported(msg));
93 }
93 }
94
94
95 for prefix in ["pre", "post", "fail"].iter() {
95 for prefix in ["pre", "post", "fail"].iter() {
96 // Mercurial allows users to define generic hooks for commands,
96 // Mercurial allows users to define generic hooks for commands,
97 // fallback if any are detected
97 // fallback if any are detected
98 let item = format!("{}-{}", prefix, subcommand_name);
98 let item = format!("{}-{}", prefix, subcommand_name);
99 let hook_for_command = config.get_str(b"hooks", item.as_bytes())?;
99 let hook_for_command = config.get_str(b"hooks", item.as_bytes())?;
100 if hook_for_command.is_some() {
100 if hook_for_command.is_some() {
101 let msg = format!("{}-{} hook defined", prefix, subcommand_name);
101 let msg = format!("{}-{} hook defined", prefix, subcommand_name);
102 return Err(CommandError::unsupported(msg));
102 return Err(CommandError::unsupported(msg));
103 }
103 }
104 }
104 }
105 let run = subcommand_run_fn(subcommand_name)
105 let run = subcommand_run_fn(subcommand_name)
106 .expect("unknown subcommand name from clap despite AppSettings::SubcommandRequired");
106 .expect("unknown subcommand name from clap despite AppSettings::SubcommandRequired");
107 let subcommand_args = subcommand_matches
107 let subcommand_args = subcommand_matches
108 .expect("no subcommand arguments from clap despite AppSettings::SubcommandRequired");
108 .expect("no subcommand arguments from clap despite AppSettings::SubcommandRequired");
109
109
110 let invocation = CliInvocation {
110 let invocation = CliInvocation {
111 ui,
111 ui,
112 subcommand_args,
112 subcommand_args,
113 config,
113 config,
114 repo,
114 repo,
115 };
115 };
116
116
117 if let Ok(repo) = repo {
117 if let Ok(repo) = repo {
118 // We don't support subrepos, fallback if the subrepos file is present
118 // We don't support subrepos, fallback if the subrepos file is present
119 if repo.working_directory_vfs().join(".hgsub").exists() {
119 if repo.working_directory_vfs().join(".hgsub").exists() {
120 let msg = "subrepos (.hgsub is present)";
120 let msg = "subrepos (.hgsub is present)";
121 return Err(CommandError::unsupported(msg));
121 return Err(CommandError::unsupported(msg));
122 }
122 }
123 }
123 }
124
124
125 if config.is_extension_enabled(b"blackbox") {
125 if config.is_extension_enabled(b"blackbox") {
126 let blackbox =
126 let blackbox =
127 blackbox::Blackbox::new(&invocation, process_start_time)?;
127 blackbox::Blackbox::new(&invocation, process_start_time)?;
128 blackbox.log_command_start(argv.iter());
128 blackbox.log_command_start(argv.iter());
129 let result = run(&invocation);
129 let result = run(&invocation);
130 blackbox.log_command_end(
130 blackbox.log_command_end(
131 argv.iter(),
131 argv.iter(),
132 exit_code(
132 exit_code(
133 &result,
133 &result,
134 // TODO: show a warning or combine with original error if
134 // TODO: show a warning or combine with original error if
135 // `get_bool` returns an error
135 // `get_bool` returns an error
136 config
136 config
137 .get_bool(b"ui", b"detailed-exit-code")
137 .get_bool(b"ui", b"detailed-exit-code")
138 .unwrap_or(false),
138 .unwrap_or(false),
139 ),
139 ),
140 );
140 );
141 result
141 result
142 } else {
142 } else {
143 run(&invocation)
143 run(&invocation)
144 }
144 }
145 }
145 }
146
146
147 fn rhg_main(argv: Vec<OsString>) -> ! {
147 fn rhg_main(argv: Vec<OsString>) -> ! {
148 // Run this first, before we find out if the blackbox extension is even
148 // Run this first, before we find out if the blackbox extension is even
149 // enabled, in order to include everything in-between in the duration
149 // enabled, in order to include everything in-between in the duration
150 // measurements. Reading config files can be slow if they’re on NFS.
150 // measurements. Reading config files can be slow if they’re on NFS.
151 let process_start_time = blackbox::ProcessStartTime::now();
151 let process_start_time = blackbox::ProcessStartTime::now();
152
152
153 env_logger::init();
153 env_logger::init();
154
154
155 let early_args = EarlyArgs::parse(&argv);
155 let early_args = EarlyArgs::parse(&argv);
156
156
157 let initial_current_dir = early_args.cwd.map(|cwd| {
157 let initial_current_dir = early_args.cwd.map(|cwd| {
158 let cwd = get_path_from_bytes(&cwd);
158 let cwd = get_path_from_bytes(&cwd);
159 std::env::current_dir()
159 std::env::current_dir()
160 .and_then(|initial| {
160 .and_then(|initial| {
161 std::env::set_current_dir(cwd)?;
161 std::env::set_current_dir(cwd)?;
162 Ok(initial)
162 Ok(initial)
163 })
163 })
164 .unwrap_or_else(|error| {
164 .unwrap_or_else(|error| {
165 exit(
165 exit(
166 &argv,
166 &argv,
167 &None,
167 &None,
168 &Ui::new_infallible(&Config::empty()),
168 &Ui::new_infallible(&Config::empty()),
169 OnUnsupported::Abort,
169 OnUnsupported::Abort,
170 Err(CommandError::abort(format!(
170 Err(CommandError::abort(format!(
171 "abort: {}: '{}'",
171 "abort: {}: '{}'",
172 error,
172 error,
173 cwd.display()
173 cwd.display()
174 ))),
174 ))),
175 false,
175 false,
176 )
176 )
177 })
177 })
178 });
178 });
179
179
180 let mut non_repo_config =
180 let mut non_repo_config =
181 Config::load_non_repo().unwrap_or_else(|error| {
181 Config::load_non_repo().unwrap_or_else(|error| {
182 // Normally this is decided based on config, but we don’t have that
182 // Normally this is decided based on config, but we don’t have that
183 // available. As of this writing config loading never returns an
183 // available. As of this writing config loading never returns an
184 // "unsupported" error but that is not enforced by the type system.
184 // "unsupported" error but that is not enforced by the type system.
185 let on_unsupported = OnUnsupported::Abort;
185 let on_unsupported = OnUnsupported::Abort;
186
186
187 exit(
187 exit(
188 &argv,
188 &argv,
189 &initial_current_dir,
189 &initial_current_dir,
190 &Ui::new_infallible(&Config::empty()),
190 &Ui::new_infallible(&Config::empty()),
191 on_unsupported,
191 on_unsupported,
192 Err(error.into()),
192 Err(error.into()),
193 false,
193 false,
194 )
194 )
195 });
195 });
196
196
197 non_repo_config
197 non_repo_config
198 .load_cli_args(early_args.config, early_args.color)
198 .load_cli_args(early_args.config, early_args.color)
199 .unwrap_or_else(|error| {
199 .unwrap_or_else(|error| {
200 exit(
200 exit(
201 &argv,
201 &argv,
202 &initial_current_dir,
202 &initial_current_dir,
203 &Ui::new_infallible(&non_repo_config),
203 &Ui::new_infallible(&non_repo_config),
204 OnUnsupported::from_config(&non_repo_config),
204 OnUnsupported::from_config(&non_repo_config),
205 Err(error.into()),
205 Err(error.into()),
206 non_repo_config
206 non_repo_config
207 .get_bool(b"ui", b"detailed-exit-code")
207 .get_bool(b"ui", b"detailed-exit-code")
208 .unwrap_or(false),
208 .unwrap_or(false),
209 )
209 )
210 });
210 });
211
211
212 if let Some(repo_path_bytes) = &early_args.repo {
212 if let Some(repo_path_bytes) = &early_args.repo {
213 lazy_static::lazy_static! {
213 lazy_static::lazy_static! {
214 static ref SCHEME_RE: regex::bytes::Regex =
214 static ref SCHEME_RE: regex::bytes::Regex =
215 // Same as `_matchscheme` in `mercurial/util.py`
215 // Same as `_matchscheme` in `mercurial/util.py`
216 regex::bytes::Regex::new("^[a-zA-Z0-9+.\\-]+:").unwrap();
216 regex::bytes::Regex::new("^[a-zA-Z0-9+.\\-]+:").unwrap();
217 }
217 }
218 if SCHEME_RE.is_match(&repo_path_bytes) {
218 if SCHEME_RE.is_match(&repo_path_bytes) {
219 exit(
219 exit(
220 &argv,
220 &argv,
221 &initial_current_dir,
221 &initial_current_dir,
222 &Ui::new_infallible(&non_repo_config),
222 &Ui::new_infallible(&non_repo_config),
223 OnUnsupported::from_config(&non_repo_config),
223 OnUnsupported::from_config(&non_repo_config),
224 Err(CommandError::UnsupportedFeature {
224 Err(CommandError::UnsupportedFeature {
225 message: format_bytes!(
225 message: format_bytes!(
226 b"URL-like --repository {}",
226 b"URL-like --repository {}",
227 repo_path_bytes
227 repo_path_bytes
228 ),
228 ),
229 }),
229 }),
230 // TODO: show a warning or combine with original error if
230 // TODO: show a warning or combine with original error if
231 // `get_bool` returns an error
231 // `get_bool` returns an error
232 non_repo_config
232 non_repo_config
233 .get_bool(b"ui", b"detailed-exit-code")
233 .get_bool(b"ui", b"detailed-exit-code")
234 .unwrap_or(false),
234 .unwrap_or(false),
235 )
235 )
236 }
236 }
237 }
237 }
238 let repo_arg = early_args.repo.unwrap_or(Vec::new());
238 let repo_arg = early_args.repo.unwrap_or(Vec::new());
239 let repo_path: Option<PathBuf> = {
239 let repo_path: Option<PathBuf> = {
240 if repo_arg.is_empty() {
240 if repo_arg.is_empty() {
241 None
241 None
242 } else {
242 } else {
243 let local_config = {
243 let local_config = {
244 if std::env::var_os("HGRCSKIPREPO").is_none() {
244 if std::env::var_os("HGRCSKIPREPO").is_none() {
245 // TODO: handle errors from find_repo_root
245 // TODO: handle errors from find_repo_root
246 if let Ok(current_dir_path) = Repo::find_repo_root() {
246 if let Ok(current_dir_path) = Repo::find_repo_root() {
247 let config_files = vec![
247 let config_files = vec![
248 ConfigSource::AbsPath(
248 ConfigSource::AbsPath(
249 current_dir_path.join(".hg/hgrc"),
249 current_dir_path.join(".hg/hgrc"),
250 ),
250 ),
251 ConfigSource::AbsPath(
251 ConfigSource::AbsPath(
252 current_dir_path.join(".hg/hgrc-not-shared"),
252 current_dir_path.join(".hg/hgrc-not-shared"),
253 ),
253 ),
254 ];
254 ];
255 // TODO: handle errors from
255 // TODO: handle errors from
256 // `load_from_explicit_sources`
256 // `load_from_explicit_sources`
257 Config::load_from_explicit_sources(config_files).ok()
257 Config::load_from_explicit_sources(config_files).ok()
258 } else {
258 } else {
259 None
259 None
260 }
260 }
261 } else {
261 } else {
262 None
262 None
263 }
263 }
264 };
264 };
265
265
266 let non_repo_config_val = {
266 let non_repo_config_val = {
267 let non_repo_val = non_repo_config.get(b"paths", &repo_arg);
267 let non_repo_val = non_repo_config.get(b"paths", &repo_arg);
268 match &non_repo_val {
268 match &non_repo_val {
269 Some(val) if val.len() > 0 => home::home_dir()
269 Some(val) if val.len() > 0 => home::home_dir()
270 .unwrap_or_else(|| PathBuf::from("~"))
270 .unwrap_or_else(|| PathBuf::from("~"))
271 .join(get_path_from_bytes(val))
271 .join(get_path_from_bytes(val))
272 .canonicalize()
272 .canonicalize()
273 // TODO: handle error and make it similar to python
273 // TODO: handle error and make it similar to python
274 // implementation maybe?
274 // implementation maybe?
275 .ok(),
275 .ok(),
276 _ => None,
276 _ => None,
277 }
277 }
278 };
278 };
279
279
280 let config_val = match &local_config {
280 let config_val = match &local_config {
281 None => non_repo_config_val,
281 None => non_repo_config_val,
282 Some(val) => {
282 Some(val) => {
283 let local_config_val = val.get(b"paths", &repo_arg);
283 let local_config_val = val.get(b"paths", &repo_arg);
284 match &local_config_val {
284 match &local_config_val {
285 Some(val) if val.len() > 0 => {
285 Some(val) if val.len() > 0 => {
286 // presence of a local_config assures that
286 // presence of a local_config assures that
287 // current_dir
287 // current_dir
288 // wont result in an Error
288 // wont result in an Error
289 let canpath = hg::utils::current_dir()
289 let canpath = hg::utils::current_dir()
290 .unwrap()
290 .unwrap()
291 .join(get_path_from_bytes(val))
291 .join(get_path_from_bytes(val))
292 .canonicalize();
292 .canonicalize();
293 canpath.ok().or(non_repo_config_val)
293 canpath.ok().or(non_repo_config_val)
294 }
294 }
295 _ => non_repo_config_val,
295 _ => non_repo_config_val,
296 }
296 }
297 }
297 }
298 };
298 };
299 config_val.or(Some(get_path_from_bytes(&repo_arg).to_path_buf()))
299 config_val.or(Some(get_path_from_bytes(&repo_arg).to_path_buf()))
300 }
300 }
301 };
301 };
302
302
303 let repo_result = match Repo::find(&non_repo_config, repo_path.to_owned())
303 let repo_result = match Repo::find(&non_repo_config, repo_path.to_owned())
304 {
304 {
305 Ok(repo) => Ok(repo),
305 Ok(repo) => Ok(repo),
306 Err(RepoError::NotFound { at }) if repo_path.is_none() => {
306 Err(RepoError::NotFound { at }) if repo_path.is_none() => {
307 // Not finding a repo is not fatal yet, if `-R` was not given
307 // Not finding a repo is not fatal yet, if `-R` was not given
308 Err(NoRepoInCwdError { cwd: at })
308 Err(NoRepoInCwdError { cwd: at })
309 }
309 }
310 Err(error) => exit(
310 Err(error) => exit(
311 &argv,
311 &argv,
312 &initial_current_dir,
312 &initial_current_dir,
313 &Ui::new_infallible(&non_repo_config),
313 &Ui::new_infallible(&non_repo_config),
314 OnUnsupported::from_config(&non_repo_config),
314 OnUnsupported::from_config(&non_repo_config),
315 Err(error.into()),
315 Err(error.into()),
316 // TODO: show a warning or combine with original error if
316 // TODO: show a warning or combine with original error if
317 // `get_bool` returns an error
317 // `get_bool` returns an error
318 non_repo_config
318 non_repo_config
319 .get_bool(b"ui", b"detailed-exit-code")
319 .get_bool(b"ui", b"detailed-exit-code")
320 .unwrap_or(false),
320 .unwrap_or(false),
321 ),
321 ),
322 };
322 };
323
323
324 let config = if let Ok(repo) = &repo_result {
324 let config = if let Ok(repo) = &repo_result {
325 repo.config()
325 repo.config()
326 } else {
326 } else {
327 &non_repo_config
327 &non_repo_config
328 };
328 };
329 let ui = Ui::new(&config).unwrap_or_else(|error| {
329 let ui = Ui::new(&config).unwrap_or_else(|error| {
330 exit(
330 exit(
331 &argv,
331 &argv,
332 &initial_current_dir,
332 &initial_current_dir,
333 &Ui::new_infallible(&config),
333 &Ui::new_infallible(&config),
334 OnUnsupported::from_config(&config),
334 OnUnsupported::from_config(&config),
335 Err(error.into()),
335 Err(error.into()),
336 config
336 config
337 .get_bool(b"ui", b"detailed-exit-code")
337 .get_bool(b"ui", b"detailed-exit-code")
338 .unwrap_or(false),
338 .unwrap_or(false),
339 )
339 )
340 });
340 });
341 let on_unsupported = OnUnsupported::from_config(config);
341 let on_unsupported = OnUnsupported::from_config(config);
342
342
343 let result = main_with_result(
343 let result = main_with_result(
344 argv.iter().map(|s| s.to_owned()).collect(),
344 argv.iter().map(|s| s.to_owned()).collect(),
345 &process_start_time,
345 &process_start_time,
346 &ui,
346 &ui,
347 repo_result.as_ref(),
347 repo_result.as_ref(),
348 config,
348 config,
349 );
349 );
350 exit(
350 exit(
351 &argv,
351 &argv,
352 &initial_current_dir,
352 &initial_current_dir,
353 &ui,
353 &ui,
354 on_unsupported,
354 on_unsupported,
355 result,
355 result,
356 // TODO: show a warning or combine with original error if `get_bool`
356 // TODO: show a warning or combine with original error if `get_bool`
357 // returns an error
357 // returns an error
358 config
358 config
359 .get_bool(b"ui", b"detailed-exit-code")
359 .get_bool(b"ui", b"detailed-exit-code")
360 .unwrap_or(false),
360 .unwrap_or(false),
361 )
361 )
362 }
362 }
363
363
364 fn main() -> ! {
364 fn main() -> ! {
365 rhg_main(std::env::args_os().collect())
365 rhg_main(std::env::args_os().collect())
366 }
366 }
367
367
368 fn exit_code(
368 fn exit_code(
369 result: &Result<(), CommandError>,
369 result: &Result<(), CommandError>,
370 use_detailed_exit_code: bool,
370 use_detailed_exit_code: bool,
371 ) -> i32 {
371 ) -> i32 {
372 match result {
372 match result {
373 Ok(()) => exit_codes::OK,
373 Ok(()) => exit_codes::OK,
374 Err(CommandError::Abort {
374 Err(CommandError::Abort {
375 message: _,
375 message: _,
376 detailed_exit_code,
376 detailed_exit_code,
377 }) => {
377 }) => {
378 if use_detailed_exit_code {
378 if use_detailed_exit_code {
379 *detailed_exit_code
379 *detailed_exit_code
380 } else {
380 } else {
381 exit_codes::ABORT
381 exit_codes::ABORT
382 }
382 }
383 }
383 }
384 Err(CommandError::Unsuccessful) => exit_codes::UNSUCCESSFUL,
384 Err(CommandError::Unsuccessful) => exit_codes::UNSUCCESSFUL,
385 // Exit with a specific code and no error message to let a potential
385 // Exit with a specific code and no error message to let a potential
386 // wrapper script fallback to Python-based Mercurial.
386 // wrapper script fallback to Python-based Mercurial.
387 Err(CommandError::UnsupportedFeature { .. }) => {
387 Err(CommandError::UnsupportedFeature { .. }) => {
388 exit_codes::UNIMPLEMENTED
388 exit_codes::UNIMPLEMENTED
389 }
389 }
390 Err(CommandError::InvalidFallback { .. }) => {
390 Err(CommandError::InvalidFallback { .. }) => {
391 exit_codes::INVALID_FALLBACK
391 exit_codes::INVALID_FALLBACK
392 }
392 }
393 }
393 }
394 }
394 }
395
395
396 fn exit<'a>(
396 fn exit<'a>(
397 original_args: &'a [OsString],
397 original_args: &'a [OsString],
398 initial_current_dir: &Option<PathBuf>,
398 initial_current_dir: &Option<PathBuf>,
399 ui: &Ui,
399 ui: &Ui,
400 mut on_unsupported: OnUnsupported,
400 mut on_unsupported: OnUnsupported,
401 result: Result<(), CommandError>,
401 result: Result<(), CommandError>,
402 use_detailed_exit_code: bool,
402 use_detailed_exit_code: bool,
403 ) -> ! {
403 ) -> ! {
404 if let (
404 if let (
405 OnUnsupported::Fallback { executable },
405 OnUnsupported::Fallback { executable },
406 Err(CommandError::UnsupportedFeature { message }),
406 Err(CommandError::UnsupportedFeature { message }),
407 ) = (&on_unsupported, &result)
407 ) = (&on_unsupported, &result)
408 {
408 {
409 let mut args = original_args.iter();
409 let mut args = original_args.iter();
410 let executable = match executable {
410 let executable = match executable {
411 None => {
411 None => {
412 exit_no_fallback(
412 exit_no_fallback(
413 ui,
413 ui,
414 OnUnsupported::Abort,
414 OnUnsupported::Abort,
415 Err(CommandError::abort(
415 Err(CommandError::abort(
416 "abort: 'rhg.on-unsupported=fallback' without \
416 "abort: 'rhg.on-unsupported=fallback' without \
417 'rhg.fallback-executable' set.",
417 'rhg.fallback-executable' set.",
418 )),
418 )),
419 false,
419 false,
420 );
420 );
421 }
421 }
422 Some(executable) => executable,
422 Some(executable) => executable,
423 };
423 };
424 let executable_path = get_path_from_bytes(&executable);
424 let executable_path = get_path_from_bytes(&executable);
425 let this_executable = args.next().expect("exepcted argv[0] to exist");
425 let this_executable = args.next().expect("exepcted argv[0] to exist");
426 if executable_path == &PathBuf::from(this_executable) {
426 if executable_path == &PathBuf::from(this_executable) {
427 // Avoid spawning infinitely many processes until resource
427 // Avoid spawning infinitely many processes until resource
428 // exhaustion.
428 // exhaustion.
429 let _ = ui.write_stderr(&format_bytes!(
429 let _ = ui.write_stderr(&format_bytes!(
430 b"Blocking recursive fallback. The 'rhg.fallback-executable = {}' config \
430 b"Blocking recursive fallback. The 'rhg.fallback-executable = {}' config \
431 points to `rhg` itself.\n",
431 points to `rhg` itself.\n",
432 executable
432 executable
433 ));
433 ));
434 on_unsupported = OnUnsupported::Abort
434 on_unsupported = OnUnsupported::Abort
435 } else {
435 } else {
436 log::debug!("falling back (see trace-level log)");
436 log::debug!("falling back (see trace-level log)");
437 log::trace!("{}", local_to_utf8(message));
437 log::trace!("{}", local_to_utf8(message));
438 if let Err(err) = which::which(executable_path) {
438 if let Err(err) = which::which(executable_path) {
439 exit_no_fallback(
439 exit_no_fallback(
440 ui,
440 ui,
441 OnUnsupported::Abort,
441 OnUnsupported::Abort,
442 Err(CommandError::InvalidFallback {
442 Err(CommandError::InvalidFallback {
443 path: executable.to_owned(),
443 path: executable.to_owned(),
444 err: err.to_string(),
444 err: err.to_string(),
445 }),
445 }),
446 use_detailed_exit_code,
446 use_detailed_exit_code,
447 )
447 )
448 }
448 }
449 // `args` is now `argv[1..]` since we’ve already consumed
449 // `args` is now `argv[1..]` since we’ve already consumed
450 // `argv[0]`
450 // `argv[0]`
451 let mut command = Command::new(executable_path);
451 let mut command = Command::new(executable_path);
452 command.args(args);
452 command.args(args);
453 if let Some(initial) = initial_current_dir {
453 if let Some(initial) = initial_current_dir {
454 command.current_dir(initial);
454 command.current_dir(initial);
455 }
455 }
456 // We don't use subprocess because proper signal handling is harder
456 // We don't use subprocess because proper signal handling is harder
457 // and we don't want to keep `rhg` around after a fallback anyway.
457 // and we don't want to keep `rhg` around after a fallback anyway.
458 // For example, if `rhg` is run in the background and falls back to
458 // For example, if `rhg` is run in the background and falls back to
459 // `hg` which, in turn, waits for a signal, we'll get stuck if
459 // `hg` which, in turn, waits for a signal, we'll get stuck if
460 // we're doing plain subprocess.
460 // we're doing plain subprocess.
461 //
461 //
462 // If `exec` returns, we can only assume our process is very broken
462 // If `exec` returns, we can only assume our process is very broken
463 // (see its documentation), so only try to forward the error code
463 // (see its documentation), so only try to forward the error code
464 // when exiting.
464 // when exiting.
465 let err = command.exec();
465 let err = command.exec();
466 std::process::exit(
466 std::process::exit(
467 err.raw_os_error().unwrap_or(exit_codes::ABORT),
467 err.raw_os_error().unwrap_or(exit_codes::ABORT),
468 );
468 );
469 }
469 }
470 }
470 }
471 exit_no_fallback(ui, on_unsupported, result, use_detailed_exit_code)
471 exit_no_fallback(ui, on_unsupported, result, use_detailed_exit_code)
472 }
472 }
473
473
474 fn exit_no_fallback(
474 fn exit_no_fallback(
475 ui: &Ui,
475 ui: &Ui,
476 on_unsupported: OnUnsupported,
476 on_unsupported: OnUnsupported,
477 result: Result<(), CommandError>,
477 result: Result<(), CommandError>,
478 use_detailed_exit_code: bool,
478 use_detailed_exit_code: bool,
479 ) -> ! {
479 ) -> ! {
480 match &result {
480 match &result {
481 Ok(_) => {}
481 Ok(_) => {}
482 Err(CommandError::Unsuccessful) => {}
482 Err(CommandError::Unsuccessful) => {}
483 Err(CommandError::Abort {
483 Err(CommandError::Abort {
484 message,
484 message,
485 detailed_exit_code: _,
485 detailed_exit_code: _,
486 }) => {
486 }) => {
487 if !message.is_empty() {
487 if !message.is_empty() {
488 // Ignore errors when writing to stderr, we’re already exiting
488 // Ignore errors when writing to stderr, we’re already exiting
489 // with failure code so there’s not much more we can do.
489 // with failure code so there’s not much more we can do.
490 let _ = ui.write_stderr(&format_bytes!(b"{}\n", message));
490 let _ = ui.write_stderr(&format_bytes!(b"{}\n", message));
491 }
491 }
492 }
492 }
493 Err(CommandError::UnsupportedFeature { message }) => {
493 Err(CommandError::UnsupportedFeature { message }) => {
494 match on_unsupported {
494 match on_unsupported {
495 OnUnsupported::Abort => {
495 OnUnsupported::Abort => {
496 let _ = ui.write_stderr(&format_bytes!(
496 let _ = ui.write_stderr(&format_bytes!(
497 b"unsupported feature: {}\n",
497 b"unsupported feature: {}\n",
498 message
498 message
499 ));
499 ));
500 }
500 }
501 OnUnsupported::AbortSilent => {}
501 OnUnsupported::AbortSilent => {}
502 OnUnsupported::Fallback { .. } => unreachable!(),
502 OnUnsupported::Fallback { .. } => unreachable!(),
503 }
503 }
504 }
504 }
505 Err(CommandError::InvalidFallback { path, err }) => {
505 Err(CommandError::InvalidFallback { path, err }) => {
506 let _ = ui.write_stderr(&format_bytes!(
506 let _ = ui.write_stderr(&format_bytes!(
507 b"abort: invalid fallback '{}': {}\n",
507 b"abort: invalid fallback '{}': {}\n",
508 path,
508 path,
509 err.as_bytes(),
509 err.as_bytes(),
510 ));
510 ));
511 }
511 }
512 }
512 }
513 std::process::exit(exit_code(&result, use_detailed_exit_code))
513 std::process::exit(exit_code(&result, use_detailed_exit_code))
514 }
514 }
515
515
516 macro_rules! subcommands {
516 macro_rules! subcommands {
517 ($( $command: ident )+) => {
517 ($( $command: ident )+) => {
518 mod commands {
518 mod commands {
519 $(
519 $(
520 pub mod $command;
520 pub mod $command;
521 )+
521 )+
522 }
522 }
523
523
524 fn add_subcommand_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> {
524 fn add_subcommand_args<'a, 'b>(app: App<'a, 'b>) -> App<'a, 'b> {
525 app
525 app
526 $(
526 $(
527 .subcommand(commands::$command::args())
527 .subcommand(commands::$command::args())
528 )+
528 )+
529 }
529 }
530
530
531 pub type RunFn = fn(&CliInvocation) -> Result<(), CommandError>;
531 pub type RunFn = fn(&CliInvocation) -> Result<(), CommandError>;
532
532
533 fn subcommand_run_fn(name: &str) -> Option<RunFn> {
533 fn subcommand_run_fn(name: &str) -> Option<RunFn> {
534 match name {
534 match name {
535 $(
535 $(
536 stringify!($command) => Some(commands::$command::run),
536 stringify!($command) => Some(commands::$command::run),
537 )+
537 )+
538 _ => None,
538 _ => None,
539 }
539 }
540 }
540 }
541 };
541 };
542 }
542 }
543
543
544 subcommands! {
544 subcommands! {
545 cat
545 cat
546 debugdata
546 debugdata
547 debugrequirements
547 debugrequirements
548 debugignorerhg
548 debugignorerhg
549 files
549 files
550 root
550 root
551 config
551 config
552 status
552 status
553 }
553 }
554
554
555 pub struct CliInvocation<'a> {
555 pub struct CliInvocation<'a> {
556 ui: &'a Ui,
556 ui: &'a Ui,
557 subcommand_args: &'a ArgMatches<'a>,
557 subcommand_args: &'a ArgMatches<'a>,
558 config: &'a Config,
558 config: &'a Config,
559 /// References inside `Result` is a bit peculiar but allow
559 /// References inside `Result` is a bit peculiar but allow
560 /// `invocation.repo?` to work out with `&CliInvocation` since this
560 /// `invocation.repo?` to work out with `&CliInvocation` since this
561 /// `Result` type is `Copy`.
561 /// `Result` type is `Copy`.
562 repo: Result<&'a Repo, &'a NoRepoInCwdError>,
562 repo: Result<&'a Repo, &'a NoRepoInCwdError>,
563 }
563 }
564
564
565 struct NoRepoInCwdError {
565 struct NoRepoInCwdError {
566 cwd: PathBuf,
566 cwd: PathBuf,
567 }
567 }
568
568
569 /// CLI arguments to be parsed "early" in order to be able to read
569 /// CLI arguments to be parsed "early" in order to be able to read
570 /// configuration before using Clap. Ideally we would also use Clap for this,
570 /// configuration before using Clap. Ideally we would also use Clap for this,
571 /// see <https://github.com/clap-rs/clap/discussions/2366>.
571 /// see <https://github.com/clap-rs/clap/discussions/2366>.
572 ///
572 ///
573 /// These arguments are still declared when we do use Clap later, so that Clap
573 /// These arguments are still declared when we do use Clap later, so that Clap
574 /// does not return an error for their presence.
574 /// does not return an error for their presence.
575 struct EarlyArgs {
575 struct EarlyArgs {
576 /// Values of all `--config` arguments. (Possibly none)
576 /// Values of all `--config` arguments. (Possibly none)
577 config: Vec<Vec<u8>>,
577 config: Vec<Vec<u8>>,
578 /// Value of all the `--color` argument, if any.
578 /// Value of all the `--color` argument, if any.
579 color: Option<Vec<u8>>,
579 color: Option<Vec<u8>>,
580 /// Value of the `-R` or `--repository` argument, if any.
580 /// Value of the `-R` or `--repository` argument, if any.
581 repo: Option<Vec<u8>>,
581 repo: Option<Vec<u8>>,
582 /// Value of the `--cwd` argument, if any.
582 /// Value of the `--cwd` argument, if any.
583 cwd: Option<Vec<u8>>,
583 cwd: Option<Vec<u8>>,
584 }
584 }
585
585
586 impl EarlyArgs {
586 impl EarlyArgs {
587 fn parse<'a>(args: impl IntoIterator<Item = &'a OsString>) -> Self {
587 fn parse<'a>(args: impl IntoIterator<Item = &'a OsString>) -> Self {
588 let mut args = args.into_iter().map(get_bytes_from_os_str);
588 let mut args = args.into_iter().map(get_bytes_from_os_str);
589 let mut config = Vec::new();
589 let mut config = Vec::new();
590 let mut color = None;
590 let mut color = None;
591 let mut repo = None;
591 let mut repo = None;
592 let mut cwd = None;
592 let mut cwd = None;
593 // Use `while let` instead of `for` so that we can also call
593 // Use `while let` instead of `for` so that we can also call
594 // `args.next()` inside the loop.
594 // `args.next()` inside the loop.
595 while let Some(arg) = args.next() {
595 while let Some(arg) = args.next() {
596 if arg == b"--config" {
596 if arg == b"--config" {
597 if let Some(value) = args.next() {
597 if let Some(value) = args.next() {
598 config.push(value)
598 config.push(value)
599 }
599 }
600 } else if let Some(value) = arg.drop_prefix(b"--config=") {
600 } else if let Some(value) = arg.drop_prefix(b"--config=") {
601 config.push(value.to_owned())
601 config.push(value.to_owned())
602 }
602 }
603
603
604 if arg == b"--color" {
604 if arg == b"--color" {
605 if let Some(value) = args.next() {
605 if let Some(value) = args.next() {
606 color = Some(value)
606 color = Some(value)
607 }
607 }
608 } else if let Some(value) = arg.drop_prefix(b"--color=") {
608 } else if let Some(value) = arg.drop_prefix(b"--color=") {
609 color = Some(value.to_owned())
609 color = Some(value.to_owned())
610 }
610 }
611
611
612 if arg == b"--cwd" {
612 if arg == b"--cwd" {
613 if let Some(value) = args.next() {
613 if let Some(value) = args.next() {
614 cwd = Some(value)
614 cwd = Some(value)
615 }
615 }
616 } else if let Some(value) = arg.drop_prefix(b"--cwd=") {
616 } else if let Some(value) = arg.drop_prefix(b"--cwd=") {
617 cwd = Some(value.to_owned())
617 cwd = Some(value.to_owned())
618 }
618 }
619
619
620 if arg == b"--repository" || arg == b"-R" {
620 if arg == b"--repository" || arg == b"-R" {
621 if let Some(value) = args.next() {
621 if let Some(value) = args.next() {
622 repo = Some(value)
622 repo = Some(value)
623 }
623 }
624 } else if let Some(value) = arg.drop_prefix(b"--repository=") {
624 } else if let Some(value) = arg.drop_prefix(b"--repository=") {
625 repo = Some(value.to_owned())
625 repo = Some(value.to_owned())
626 } else if let Some(value) = arg.drop_prefix(b"-R") {
626 } else if let Some(value) = arg.drop_prefix(b"-R") {
627 repo = Some(value.to_owned())
627 repo = Some(value.to_owned())
628 }
628 }
629 }
629 }
630 Self {
630 Self {
631 config,
631 config,
632 color,
632 color,
633 repo,
633 repo,
634 cwd,
634 cwd,
635 }
635 }
636 }
636 }
637 }
637 }
638
638
639 /// What to do when encountering some unsupported feature.
639 /// What to do when encountering some unsupported feature.
640 ///
640 ///
641 /// See `HgError::UnsupportedFeature` and `CommandError::UnsupportedFeature`.
641 /// See `HgError::UnsupportedFeature` and `CommandError::UnsupportedFeature`.
642 enum OnUnsupported {
642 enum OnUnsupported {
643 /// Print an error message describing what feature is not supported,
643 /// Print an error message describing what feature is not supported,
644 /// and exit with code 252.
644 /// and exit with code 252.
645 Abort,
645 Abort,
646 /// Silently exit with code 252.
646 /// Silently exit with code 252.
647 AbortSilent,
647 AbortSilent,
648 /// Try running a Python implementation
648 /// Try running a Python implementation
649 Fallback { executable: Option<Vec<u8>> },
649 Fallback { executable: Option<Vec<u8>> },
650 }
650 }
651
651
652 impl OnUnsupported {
652 impl OnUnsupported {
653 const DEFAULT: Self = OnUnsupported::Abort;
653 const DEFAULT: Self = OnUnsupported::Abort;
654
654
655 fn from_config(config: &Config) -> Self {
655 fn from_config(config: &Config) -> Self {
656 match config
656 match config
657 .get(b"rhg", b"on-unsupported")
657 .get(b"rhg", b"on-unsupported")
658 .map(|value| value.to_ascii_lowercase())
658 .map(|value| value.to_ascii_lowercase())
659 .as_deref()
659 .as_deref()
660 {
660 {
661 Some(b"abort") => OnUnsupported::Abort,
661 Some(b"abort") => OnUnsupported::Abort,
662 Some(b"abort-silent") => OnUnsupported::AbortSilent,
662 Some(b"abort-silent") => OnUnsupported::AbortSilent,
663 Some(b"fallback") => OnUnsupported::Fallback {
663 Some(b"fallback") => OnUnsupported::Fallback {
664 executable: config
664 executable: config
665 .get(b"rhg", b"fallback-executable")
665 .get(b"rhg", b"fallback-executable")
666 .map(|x| x.to_owned()),
666 .map(|x| x.to_owned()),
667 },
667 },
668 None => Self::DEFAULT,
668 None => Self::DEFAULT,
669 Some(_) => {
669 Some(_) => {
670 // TODO: warn about unknown config value
670 // TODO: warn about unknown config value
671 Self::DEFAULT
671 Self::DEFAULT
672 }
672 }
673 }
673 }
674 }
674 }
675 }
675 }
676
676
677 /// The `*` extension is an edge-case for config sub-options that apply to all
677 /// The `*` extension is an edge-case for config sub-options that apply to all
678 /// extensions. For now, only `:required` exists, but that may change in the
678 /// extensions. For now, only `:required` exists, but that may change in the
679 /// future.
679 /// future.
680 const SUPPORTED_EXTENSIONS: &[&[u8]] =
680 const SUPPORTED_EXTENSIONS: &[&[u8]] =
681 &[b"blackbox", b"share", b"sparse", b"narrow", b"*"];
681 &[b"blackbox", b"share", b"sparse", b"narrow", b"*"];
682
682
683 fn check_extensions(config: &Config) -> Result<(), CommandError> {
683 fn check_extensions(config: &Config) -> Result<(), CommandError> {
684 if let Some(b"*") = config.get(b"rhg", b"ignored-extensions") {
684 if let Some(b"*") = config.get(b"rhg", b"ignored-extensions") {
685 // All extensions are to be ignored, nothing to do here
685 // All extensions are to be ignored, nothing to do here
686 return Ok(());
686 return Ok(());
687 }
687 }
688
688
689 let enabled: HashSet<&[u8]> = config
689 let enabled: HashSet<&[u8]> = config
690 .get_section_keys(b"extensions")
690 .iter_section(b"extensions")
691 .into_iter()
691 .filter_map(|(extension, value)| {
692 .map(|extension| {
692 if value == b"!" {
693 // Filter out disabled extensions
694 return None;
695 }
693 // Ignore extension suboptions. Only `required` exists for now.
696 // Ignore extension suboptions. Only `required` exists for now.
694 // `rhg` either supports an extension or doesn't, so it doesn't
697 // `rhg` either supports an extension or doesn't, so it doesn't
695 // make sense to consider the loading of an extension.
698 // make sense to consider the loading of an extension.
696 extension.split_2(b':').unwrap_or((extension, b"")).0
699 let actual_extension =
700 extension.split_2(b':').unwrap_or((extension, b"")).0;
701 Some(actual_extension)
697 })
702 })
698 .collect();
703 .collect();
699
704
700 let mut unsupported = enabled;
705 let mut unsupported = enabled;
701 for supported in SUPPORTED_EXTENSIONS {
706 for supported in SUPPORTED_EXTENSIONS {
702 unsupported.remove(supported);
707 unsupported.remove(supported);
703 }
708 }
704
709
705 if let Some(ignored_list) = config.get_list(b"rhg", b"ignored-extensions")
710 if let Some(ignored_list) = config.get_list(b"rhg", b"ignored-extensions")
706 {
711 {
707 for ignored in ignored_list {
712 for ignored in ignored_list {
708 unsupported.remove(ignored.as_slice());
713 unsupported.remove(ignored.as_slice());
709 }
714 }
710 }
715 }
711
716
712 if unsupported.is_empty() {
717 if unsupported.is_empty() {
713 Ok(())
718 Ok(())
714 } else {
719 } else {
715 let mut unsupported: Vec<_> = unsupported.into_iter().collect();
720 let mut unsupported: Vec<_> = unsupported.into_iter().collect();
716 // Sort the extensions to get a stable output
721 // Sort the extensions to get a stable output
717 unsupported.sort();
722 unsupported.sort();
718 Err(CommandError::UnsupportedFeature {
723 Err(CommandError::UnsupportedFeature {
719 message: format_bytes!(
724 message: format_bytes!(
720 b"extensions: {} (consider adding them to 'rhg.ignored-extensions' config)",
725 b"extensions: {} (consider adding them to 'rhg.ignored-extensions' config)",
721 join(unsupported, b", ")
726 join(unsupported, b", ")
722 ),
727 ),
723 })
728 })
724 }
729 }
725 }
730 }
726
731
727 /// Array of tuples of (auto upgrade conf, feature conf, local requirement)
732 /// Array of tuples of (auto upgrade conf, feature conf, local requirement)
728 const AUTO_UPGRADES: &[((&str, &str), (&str, &str), &str)] = &[
733 const AUTO_UPGRADES: &[((&str, &str), (&str, &str), &str)] = &[
729 (
734 (
730 ("format", "use-share-safe.automatic-upgrade-of-mismatching-repositories"),
735 ("format", "use-share-safe.automatic-upgrade-of-mismatching-repositories"),
731 ("format", "use-share-safe"),
736 ("format", "use-share-safe"),
732 requirements::SHARESAFE_REQUIREMENT,
737 requirements::SHARESAFE_REQUIREMENT,
733 ),
738 ),
734 (
739 (
735 ("format", "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"),
740 ("format", "use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories"),
736 ("format", "use-dirstate-tracked-hint"),
741 ("format", "use-dirstate-tracked-hint"),
737 requirements::DIRSTATE_TRACKED_HINT_V1,
742 requirements::DIRSTATE_TRACKED_HINT_V1,
738 ),
743 ),
739 (
744 (
740 ("use-dirstate-v2", "automatic-upgrade-of-mismatching-repositories"),
745 ("use-dirstate-v2", "automatic-upgrade-of-mismatching-repositories"),
741 ("format", "use-dirstate-v2"),
746 ("format", "use-dirstate-v2"),
742 requirements::DIRSTATE_V2_REQUIREMENT,
747 requirements::DIRSTATE_V2_REQUIREMENT,
743 ),
748 ),
744 ];
749 ];
745
750
746 /// Mercurial allows users to automatically upgrade their repository.
751 /// Mercurial allows users to automatically upgrade their repository.
747 /// `rhg` does not have the ability to upgrade yet, so fallback if an upgrade
752 /// `rhg` does not have the ability to upgrade yet, so fallback if an upgrade
748 /// is needed.
753 /// is needed.
749 fn check_auto_upgrade(
754 fn check_auto_upgrade(
750 config: &Config,
755 config: &Config,
751 reqs: &HashSet<String>,
756 reqs: &HashSet<String>,
752 ) -> Result<(), CommandError> {
757 ) -> Result<(), CommandError> {
753 for (upgrade_conf, feature_conf, local_req) in AUTO_UPGRADES.iter() {
758 for (upgrade_conf, feature_conf, local_req) in AUTO_UPGRADES.iter() {
754 let auto_upgrade = config
759 let auto_upgrade = config
755 .get_bool(upgrade_conf.0.as_bytes(), upgrade_conf.1.as_bytes())?;
760 .get_bool(upgrade_conf.0.as_bytes(), upgrade_conf.1.as_bytes())?;
756
761
757 if auto_upgrade {
762 if auto_upgrade {
758 let want_it = config.get_bool(
763 let want_it = config.get_bool(
759 feature_conf.0.as_bytes(),
764 feature_conf.0.as_bytes(),
760 feature_conf.1.as_bytes(),
765 feature_conf.1.as_bytes(),
761 )?;
766 )?;
762 let have_it = reqs.contains(*local_req);
767 let have_it = reqs.contains(*local_req);
763
768
764 let action = match (want_it, have_it) {
769 let action = match (want_it, have_it) {
765 (true, false) => Some("upgrade"),
770 (true, false) => Some("upgrade"),
766 (false, true) => Some("downgrade"),
771 (false, true) => Some("downgrade"),
767 _ => None,
772 _ => None,
768 };
773 };
769 if let Some(action) = action {
774 if let Some(action) = action {
770 let message = format!(
775 let message = format!(
771 "automatic {} {}.{}",
776 "automatic {} {}.{}",
772 action, upgrade_conf.0, upgrade_conf.1
777 action, upgrade_conf.0, upgrade_conf.1
773 );
778 );
774 return Err(CommandError::unsupported(message));
779 return Err(CommandError::unsupported(message));
775 }
780 }
776 }
781 }
777 }
782 }
778 Ok(())
783 Ok(())
779 }
784 }
780
785
781 fn check_unsupported(
786 fn check_unsupported(
782 config: &Config,
787 config: &Config,
783 repo: Result<&Repo, &NoRepoInCwdError>,
788 repo: Result<&Repo, &NoRepoInCwdError>,
784 ) -> Result<(), CommandError> {
789 ) -> Result<(), CommandError> {
785 check_extensions(config)?;
790 check_extensions(config)?;
786
791
787 if std::env::var_os("HG_PENDING").is_some() {
792 if std::env::var_os("HG_PENDING").is_some() {
788 // TODO: only if the value is `== repo.working_directory`?
793 // TODO: only if the value is `== repo.working_directory`?
789 // What about relative v.s. absolute paths?
794 // What about relative v.s. absolute paths?
790 Err(CommandError::unsupported("$HG_PENDING"))?
795 Err(CommandError::unsupported("$HG_PENDING"))?
791 }
796 }
792
797
793 if let Ok(repo) = repo {
798 if let Ok(repo) = repo {
794 if repo.has_subrepos()? {
799 if repo.has_subrepos()? {
795 Err(CommandError::unsupported("sub-repositories"))?
800 Err(CommandError::unsupported("sub-repositories"))?
796 }
801 }
797 check_auto_upgrade(config, repo.requirements())?;
802 check_auto_upgrade(config, repo.requirements())?;
798 }
803 }
799
804
800 if config.has_non_empty_section(b"encode") {
805 if config.has_non_empty_section(b"encode") {
801 Err(CommandError::unsupported("[encode] config"))?
806 Err(CommandError::unsupported("[encode] config"))?
802 }
807 }
803
808
804 if config.has_non_empty_section(b"decode") {
809 if config.has_non_empty_section(b"decode") {
805 Err(CommandError::unsupported("[decode] config"))?
810 Err(CommandError::unsupported("[decode] config"))?
806 }
811 }
807
812
808 Ok(())
813 Ok(())
809 }
814 }
@@ -1,2970 +1,2974 b''
1 Log on empty repository: checking consistency
1 Log on empty repository: checking consistency
2
2
3 $ hg init empty
3 $ hg init empty
4 $ cd empty
4 $ cd empty
5 $ hg log
5 $ hg log
6 $ hg log -r 1
6 $ hg log -r 1
7 abort: unknown revision '1'
7 abort: unknown revision '1'
8 [10]
8 [10]
9 $ hg log -r -1:0
9 $ hg log -r -1:0
10 abort: unknown revision '-1'
10 abort: unknown revision '-1'
11 [10]
11 [10]
12 $ hg log -r 'branch(name)'
12 $ hg log -r 'branch(name)'
13 abort: unknown revision 'name'
13 abort: unknown revision 'name'
14 [10]
14 [10]
15 $ hg log -r null -q
15 $ hg log -r null -q
16 -1:000000000000
16 -1:000000000000
17
17
18 $ cd ..
18 $ cd ..
19
19
20 The g is crafted to have 2 filelog topological heads in a linear
20 The g is crafted to have 2 filelog topological heads in a linear
21 changeset graph
21 changeset graph
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ echo a > a
25 $ echo a > a
26 $ echo f > f
26 $ echo f > f
27 $ hg ci -Ama -d '1 0'
27 $ hg ci -Ama -d '1 0'
28 adding a
28 adding a
29 adding f
29 adding f
30
30
31 $ hg cp a b
31 $ hg cp a b
32 $ hg cp f g
32 $ hg cp f g
33 $ hg ci -mb -d '2 0'
33 $ hg ci -mb -d '2 0'
34
34
35 $ mkdir dir
35 $ mkdir dir
36 $ hg mv b dir
36 $ hg mv b dir
37 $ echo g >> g
37 $ echo g >> g
38 $ echo f >> f
38 $ echo f >> f
39 $ hg ci -mc -d '3 0'
39 $ hg ci -mc -d '3 0'
40
40
41 $ hg mv a b
41 $ hg mv a b
42 $ hg cp -f f g
42 $ hg cp -f f g
43 $ echo a > d
43 $ echo a > d
44 $ hg add d
44 $ hg add d
45 $ hg ci -md -d '4 0'
45 $ hg ci -md -d '4 0'
46
46
47 $ hg mv dir/b e
47 $ hg mv dir/b e
48 $ hg ci -me -d '5 0'
48 $ hg ci -me -d '5 0'
49
49
50 Make sure largefiles doesn't interfere with logging a regular file
50 Make sure largefiles doesn't interfere with logging a regular file
51 $ hg --debug log a -T '{rev}: {desc}\n' --config extensions.largefiles=
51 $ hg --debug log a -T '{rev}: {desc}\n' --config extensions.largefiles=
52 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
52 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
53 updated patterns: .hglf/a, a
53 updated patterns: .hglf/a, a
54 0: a
54 0: a
55 $ hg log a
55 $ hg log a
56 changeset: 0:9161b9aeaf16
56 changeset: 0:9161b9aeaf16
57 user: test
57 user: test
58 date: Thu Jan 01 00:00:01 1970 +0000
58 date: Thu Jan 01 00:00:01 1970 +0000
59 summary: a
59 summary: a
60
60
61 $ hg log glob:a*
61 $ hg log glob:a*
62 changeset: 3:2ca5ba701980
62 changeset: 3:2ca5ba701980
63 user: test
63 user: test
64 date: Thu Jan 01 00:00:04 1970 +0000
64 date: Thu Jan 01 00:00:04 1970 +0000
65 summary: d
65 summary: d
66
66
67 changeset: 0:9161b9aeaf16
67 changeset: 0:9161b9aeaf16
68 user: test
68 user: test
69 date: Thu Jan 01 00:00:01 1970 +0000
69 date: Thu Jan 01 00:00:01 1970 +0000
70 summary: a
70 summary: a
71
71
72 $ hg --debug log glob:a* -T '{rev}: {desc}\n' --config extensions.largefiles=
72 $ hg --debug log glob:a* -T '{rev}: {desc}\n' --config extensions.largefiles=
73 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
73 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
74 updated patterns: glob:.hglf/a*, glob:a*
74 updated patterns: glob:.hglf/a*, glob:a*
75 3: d
75 3: d
76 0: a
76 0: a
77
77
78 log on directory
78 log on directory
79
79
80 $ hg log dir
80 $ hg log dir
81 changeset: 4:7e4639b4691b
81 changeset: 4:7e4639b4691b
82 tag: tip
82 tag: tip
83 user: test
83 user: test
84 date: Thu Jan 01 00:00:05 1970 +0000
84 date: Thu Jan 01 00:00:05 1970 +0000
85 summary: e
85 summary: e
86
86
87 changeset: 2:f8954cd4dc1f
87 changeset: 2:f8954cd4dc1f
88 user: test
88 user: test
89 date: Thu Jan 01 00:00:03 1970 +0000
89 date: Thu Jan 01 00:00:03 1970 +0000
90 summary: c
90 summary: c
91
91
92 $ hg log somethingthatdoesntexist dir
92 $ hg log somethingthatdoesntexist dir
93 changeset: 4:7e4639b4691b
93 changeset: 4:7e4639b4691b
94 tag: tip
94 tag: tip
95 user: test
95 user: test
96 date: Thu Jan 01 00:00:05 1970 +0000
96 date: Thu Jan 01 00:00:05 1970 +0000
97 summary: e
97 summary: e
98
98
99 changeset: 2:f8954cd4dc1f
99 changeset: 2:f8954cd4dc1f
100 user: test
100 user: test
101 date: Thu Jan 01 00:00:03 1970 +0000
101 date: Thu Jan 01 00:00:03 1970 +0000
102 summary: c
102 summary: c
103
103
104
104
105 log empty path (or repo root) of slow path shouldn't crash (issue6478)
105 log empty path (or repo root) of slow path shouldn't crash (issue6478)
106
106
107 $ hg log -ql1 '' inexistent
107 $ hg log -ql1 '' inexistent
108 4:7e4639b4691b
108 4:7e4639b4691b
109 $ hg log -ql1 . inexistent
109 $ hg log -ql1 . inexistent
110 4:7e4639b4691b
110 4:7e4639b4691b
111 $ hg log -ql1 "`pwd`" inexistent
111 $ hg log -ql1 "`pwd`" inexistent
112 4:7e4639b4691b
112 4:7e4639b4691b
113
113
114 $ hg log -ql1 '' e
114 $ hg log -ql1 '' e
115 4:7e4639b4691b
115 4:7e4639b4691b
116 $ hg log -ql1 . e
116 $ hg log -ql1 . e
117 4:7e4639b4691b
117 4:7e4639b4691b
118 $ hg log -ql1 "`pwd`" e
118 $ hg log -ql1 "`pwd`" e
119 4:7e4639b4691b
119 4:7e4639b4691b
120
120
121 log -f empty path (or repo root) shouldn't crash
121 log -f empty path (or repo root) shouldn't crash
122
122
123 $ hg log -qfl1 '' inexistent
123 $ hg log -qfl1 '' inexistent
124 abort: cannot follow file not in parent revision: "inexistent"
124 abort: cannot follow file not in parent revision: "inexistent"
125 [20]
125 [20]
126 $ hg log -qfl1 . inexistent
126 $ hg log -qfl1 . inexistent
127 abort: cannot follow file not in parent revision: "inexistent"
127 abort: cannot follow file not in parent revision: "inexistent"
128 [20]
128 [20]
129 $ hg log -qfl1 "`pwd`" inexistent
129 $ hg log -qfl1 "`pwd`" inexistent
130 abort: cannot follow file not in parent revision: "inexistent"
130 abort: cannot follow file not in parent revision: "inexistent"
131 [20]
131 [20]
132
132
133 $ hg log -qfl1 '' e
133 $ hg log -qfl1 '' e
134 4:7e4639b4691b
134 4:7e4639b4691b
135 $ hg log -qfl1 . e
135 $ hg log -qfl1 . e
136 4:7e4639b4691b
136 4:7e4639b4691b
137 $ hg log -qfl1 "`pwd`" e
137 $ hg log -qfl1 "`pwd`" e
138 4:7e4639b4691b
138 4:7e4639b4691b
139
139
140 -X, with explicit path
140 -X, with explicit path
141
141
142 $ hg log a -X a
142 $ hg log a -X a
143
143
144 -f, non-existent directory
144 -f, non-existent directory
145
145
146 $ hg log -f dir
146 $ hg log -f dir
147 abort: cannot follow file not in parent revision: "dir"
147 abort: cannot follow file not in parent revision: "dir"
148 [20]
148 [20]
149
149
150 -f, directory
150 -f, directory
151
151
152 $ hg up -q 3
152 $ hg up -q 3
153 $ hg log -f dir
153 $ hg log -f dir
154 changeset: 2:f8954cd4dc1f
154 changeset: 2:f8954cd4dc1f
155 user: test
155 user: test
156 date: Thu Jan 01 00:00:03 1970 +0000
156 date: Thu Jan 01 00:00:03 1970 +0000
157 summary: c
157 summary: c
158
158
159 -f, directory with --patch
159 -f, directory with --patch
160
160
161 $ hg log -f dir -p
161 $ hg log -f dir -p
162 changeset: 2:f8954cd4dc1f
162 changeset: 2:f8954cd4dc1f
163 user: test
163 user: test
164 date: Thu Jan 01 00:00:03 1970 +0000
164 date: Thu Jan 01 00:00:03 1970 +0000
165 summary: c
165 summary: c
166
166
167 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
167 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
168 --- /dev/null* (glob)
168 --- /dev/null* (glob)
169 +++ b/dir/b* (glob)
169 +++ b/dir/b* (glob)
170 @@ -0,0 +1,1 @@
170 @@ -0,0 +1,1 @@
171 +a
171 +a
172
172
173
173
174 -f, pattern
174 -f, pattern
175
175
176 $ hg log -f -I 'dir**' -p
176 $ hg log -f -I 'dir**' -p
177 changeset: 2:f8954cd4dc1f
177 changeset: 2:f8954cd4dc1f
178 user: test
178 user: test
179 date: Thu Jan 01 00:00:03 1970 +0000
179 date: Thu Jan 01 00:00:03 1970 +0000
180 summary: c
180 summary: c
181
181
182 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
182 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
183 --- /dev/null* (glob)
183 --- /dev/null* (glob)
184 +++ b/dir/b* (glob)
184 +++ b/dir/b* (glob)
185 @@ -0,0 +1,1 @@
185 @@ -0,0 +1,1 @@
186 +a
186 +a
187
187
188 $ hg up -q 4
188 $ hg up -q 4
189
189
190 -f, a wrong style
190 -f, a wrong style
191
191
192 $ hg log -f -l1 --style something
192 $ hg log -f -l1 --style something
193 abort: style 'something' not found
193 abort: style 'something' not found
194 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
194 (available styles: bisect, changelog, compact, default, phases, show, status, xml)
195 [255]
195 [255]
196
196
197 -f, phases style
197 -f, phases style
198
198
199
199
200 $ hg log -f -l1 --style phases
200 $ hg log -f -l1 --style phases
201 changeset: 4:7e4639b4691b
201 changeset: 4:7e4639b4691b
202 tag: tip
202 tag: tip
203 phase: draft
203 phase: draft
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:05 1970 +0000
205 date: Thu Jan 01 00:00:05 1970 +0000
206 summary: e
206 summary: e
207
207
208
208
209 $ hg log -f -l1 --style phases -q
209 $ hg log -f -l1 --style phases -q
210 4:7e4639b4691b
210 4:7e4639b4691b
211
211
212 -f, but no args
212 -f, but no args
213
213
214 $ hg log -f
214 $ hg log -f
215 changeset: 4:7e4639b4691b
215 changeset: 4:7e4639b4691b
216 tag: tip
216 tag: tip
217 user: test
217 user: test
218 date: Thu Jan 01 00:00:05 1970 +0000
218 date: Thu Jan 01 00:00:05 1970 +0000
219 summary: e
219 summary: e
220
220
221 changeset: 3:2ca5ba701980
221 changeset: 3:2ca5ba701980
222 user: test
222 user: test
223 date: Thu Jan 01 00:00:04 1970 +0000
223 date: Thu Jan 01 00:00:04 1970 +0000
224 summary: d
224 summary: d
225
225
226 changeset: 2:f8954cd4dc1f
226 changeset: 2:f8954cd4dc1f
227 user: test
227 user: test
228 date: Thu Jan 01 00:00:03 1970 +0000
228 date: Thu Jan 01 00:00:03 1970 +0000
229 summary: c
229 summary: c
230
230
231 changeset: 1:d89b0a12d229
231 changeset: 1:d89b0a12d229
232 user: test
232 user: test
233 date: Thu Jan 01 00:00:02 1970 +0000
233 date: Thu Jan 01 00:00:02 1970 +0000
234 summary: b
234 summary: b
235
235
236 changeset: 0:9161b9aeaf16
236 changeset: 0:9161b9aeaf16
237 user: test
237 user: test
238 date: Thu Jan 01 00:00:01 1970 +0000
238 date: Thu Jan 01 00:00:01 1970 +0000
239 summary: a
239 summary: a
240
240
241
241
242 one rename
242 one rename
243
243
244 $ hg up -q 2
244 $ hg up -q 2
245 $ hg log -vf a
245 $ hg log -vf a
246 changeset: 0:9161b9aeaf16
246 changeset: 0:9161b9aeaf16
247 user: test
247 user: test
248 date: Thu Jan 01 00:00:01 1970 +0000
248 date: Thu Jan 01 00:00:01 1970 +0000
249 files: a f
249 files: a f
250 description:
250 description:
251 a
251 a
252
252
253
253
254
254
255 many renames
255 many renames
256
256
257 $ hg up -q tip
257 $ hg up -q tip
258 $ hg log -vf e
258 $ hg log -vf e
259 changeset: 4:7e4639b4691b
259 changeset: 4:7e4639b4691b
260 tag: tip
260 tag: tip
261 user: test
261 user: test
262 date: Thu Jan 01 00:00:05 1970 +0000
262 date: Thu Jan 01 00:00:05 1970 +0000
263 files: dir/b e
263 files: dir/b e
264 description:
264 description:
265 e
265 e
266
266
267
267
268 changeset: 2:f8954cd4dc1f
268 changeset: 2:f8954cd4dc1f
269 user: test
269 user: test
270 date: Thu Jan 01 00:00:03 1970 +0000
270 date: Thu Jan 01 00:00:03 1970 +0000
271 files: b dir/b f g
271 files: b dir/b f g
272 description:
272 description:
273 c
273 c
274
274
275
275
276 changeset: 1:d89b0a12d229
276 changeset: 1:d89b0a12d229
277 user: test
277 user: test
278 date: Thu Jan 01 00:00:02 1970 +0000
278 date: Thu Jan 01 00:00:02 1970 +0000
279 files: b g
279 files: b g
280 description:
280 description:
281 b
281 b
282
282
283
283
284 changeset: 0:9161b9aeaf16
284 changeset: 0:9161b9aeaf16
285 user: test
285 user: test
286 date: Thu Jan 01 00:00:01 1970 +0000
286 date: Thu Jan 01 00:00:01 1970 +0000
287 files: a f
287 files: a f
288 description:
288 description:
289 a
289 a
290
290
291
291
292
292
293
293
294 log -pf dir/b
294 log -pf dir/b
295
295
296 $ hg up -q 3
296 $ hg up -q 3
297 $ hg log -pf dir/b
297 $ hg log -pf dir/b
298 changeset: 2:f8954cd4dc1f
298 changeset: 2:f8954cd4dc1f
299 user: test
299 user: test
300 date: Thu Jan 01 00:00:03 1970 +0000
300 date: Thu Jan 01 00:00:03 1970 +0000
301 summary: c
301 summary: c
302
302
303 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
303 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
304 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
304 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
305 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
305 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
306 @@ -0,0 +1,1 @@
306 @@ -0,0 +1,1 @@
307 +a
307 +a
308
308
309 changeset: 1:d89b0a12d229
309 changeset: 1:d89b0a12d229
310 user: test
310 user: test
311 date: Thu Jan 01 00:00:02 1970 +0000
311 date: Thu Jan 01 00:00:02 1970 +0000
312 summary: b
312 summary: b
313
313
314 diff -r 9161b9aeaf16 -r d89b0a12d229 b
314 diff -r 9161b9aeaf16 -r d89b0a12d229 b
315 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
315 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
316 +++ b/b Thu Jan 01 00:00:02 1970 +0000
316 +++ b/b Thu Jan 01 00:00:02 1970 +0000
317 @@ -0,0 +1,1 @@
317 @@ -0,0 +1,1 @@
318 +a
318 +a
319
319
320 changeset: 0:9161b9aeaf16
320 changeset: 0:9161b9aeaf16
321 user: test
321 user: test
322 date: Thu Jan 01 00:00:01 1970 +0000
322 date: Thu Jan 01 00:00:01 1970 +0000
323 summary: a
323 summary: a
324
324
325 diff -r 000000000000 -r 9161b9aeaf16 a
325 diff -r 000000000000 -r 9161b9aeaf16 a
326 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
326 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
327 +++ b/a Thu Jan 01 00:00:01 1970 +0000
327 +++ b/a Thu Jan 01 00:00:01 1970 +0000
328 @@ -0,0 +1,1 @@
328 @@ -0,0 +1,1 @@
329 +a
329 +a
330
330
331
331
332 log -pf b inside dir
332 log -pf b inside dir
333
333
334 $ hg --cwd=dir log -pf b
334 $ hg --cwd=dir log -pf b
335 changeset: 2:f8954cd4dc1f
335 changeset: 2:f8954cd4dc1f
336 user: test
336 user: test
337 date: Thu Jan 01 00:00:03 1970 +0000
337 date: Thu Jan 01 00:00:03 1970 +0000
338 summary: c
338 summary: c
339
339
340 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
340 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
341 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
341 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
342 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
342 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
343 @@ -0,0 +1,1 @@
343 @@ -0,0 +1,1 @@
344 +a
344 +a
345
345
346 changeset: 1:d89b0a12d229
346 changeset: 1:d89b0a12d229
347 user: test
347 user: test
348 date: Thu Jan 01 00:00:02 1970 +0000
348 date: Thu Jan 01 00:00:02 1970 +0000
349 summary: b
349 summary: b
350
350
351 diff -r 9161b9aeaf16 -r d89b0a12d229 b
351 diff -r 9161b9aeaf16 -r d89b0a12d229 b
352 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
352 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
353 +++ b/b Thu Jan 01 00:00:02 1970 +0000
353 +++ b/b Thu Jan 01 00:00:02 1970 +0000
354 @@ -0,0 +1,1 @@
354 @@ -0,0 +1,1 @@
355 +a
355 +a
356
356
357 changeset: 0:9161b9aeaf16
357 changeset: 0:9161b9aeaf16
358 user: test
358 user: test
359 date: Thu Jan 01 00:00:01 1970 +0000
359 date: Thu Jan 01 00:00:01 1970 +0000
360 summary: a
360 summary: a
361
361
362 diff -r 000000000000 -r 9161b9aeaf16 a
362 diff -r 000000000000 -r 9161b9aeaf16 a
363 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
363 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
364 +++ b/a Thu Jan 01 00:00:01 1970 +0000
364 +++ b/a Thu Jan 01 00:00:01 1970 +0000
365 @@ -0,0 +1,1 @@
365 @@ -0,0 +1,1 @@
366 +a
366 +a
367
367
368
368
369 log -pf, but no args
369 log -pf, but no args
370
370
371 $ hg log -pf
371 $ hg log -pf
372 changeset: 3:2ca5ba701980
372 changeset: 3:2ca5ba701980
373 user: test
373 user: test
374 date: Thu Jan 01 00:00:04 1970 +0000
374 date: Thu Jan 01 00:00:04 1970 +0000
375 summary: d
375 summary: d
376
376
377 diff -r f8954cd4dc1f -r 2ca5ba701980 a
377 diff -r f8954cd4dc1f -r 2ca5ba701980 a
378 --- a/a Thu Jan 01 00:00:03 1970 +0000
378 --- a/a Thu Jan 01 00:00:03 1970 +0000
379 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
379 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
380 @@ -1,1 +0,0 @@
380 @@ -1,1 +0,0 @@
381 -a
381 -a
382 diff -r f8954cd4dc1f -r 2ca5ba701980 b
382 diff -r f8954cd4dc1f -r 2ca5ba701980 b
383 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
383 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
384 +++ b/b Thu Jan 01 00:00:04 1970 +0000
384 +++ b/b Thu Jan 01 00:00:04 1970 +0000
385 @@ -0,0 +1,1 @@
385 @@ -0,0 +1,1 @@
386 +a
386 +a
387 diff -r f8954cd4dc1f -r 2ca5ba701980 d
387 diff -r f8954cd4dc1f -r 2ca5ba701980 d
388 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
388 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
389 +++ b/d Thu Jan 01 00:00:04 1970 +0000
389 +++ b/d Thu Jan 01 00:00:04 1970 +0000
390 @@ -0,0 +1,1 @@
390 @@ -0,0 +1,1 @@
391 +a
391 +a
392 diff -r f8954cd4dc1f -r 2ca5ba701980 g
392 diff -r f8954cd4dc1f -r 2ca5ba701980 g
393 --- a/g Thu Jan 01 00:00:03 1970 +0000
393 --- a/g Thu Jan 01 00:00:03 1970 +0000
394 +++ b/g Thu Jan 01 00:00:04 1970 +0000
394 +++ b/g Thu Jan 01 00:00:04 1970 +0000
395 @@ -1,2 +1,2 @@
395 @@ -1,2 +1,2 @@
396 f
396 f
397 -g
397 -g
398 +f
398 +f
399
399
400 changeset: 2:f8954cd4dc1f
400 changeset: 2:f8954cd4dc1f
401 user: test
401 user: test
402 date: Thu Jan 01 00:00:03 1970 +0000
402 date: Thu Jan 01 00:00:03 1970 +0000
403 summary: c
403 summary: c
404
404
405 diff -r d89b0a12d229 -r f8954cd4dc1f b
405 diff -r d89b0a12d229 -r f8954cd4dc1f b
406 --- a/b Thu Jan 01 00:00:02 1970 +0000
406 --- a/b Thu Jan 01 00:00:02 1970 +0000
407 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
407 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
408 @@ -1,1 +0,0 @@
408 @@ -1,1 +0,0 @@
409 -a
409 -a
410 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
410 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
411 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
411 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
412 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
412 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
413 @@ -0,0 +1,1 @@
413 @@ -0,0 +1,1 @@
414 +a
414 +a
415 diff -r d89b0a12d229 -r f8954cd4dc1f f
415 diff -r d89b0a12d229 -r f8954cd4dc1f f
416 --- a/f Thu Jan 01 00:00:02 1970 +0000
416 --- a/f Thu Jan 01 00:00:02 1970 +0000
417 +++ b/f Thu Jan 01 00:00:03 1970 +0000
417 +++ b/f Thu Jan 01 00:00:03 1970 +0000
418 @@ -1,1 +1,2 @@
418 @@ -1,1 +1,2 @@
419 f
419 f
420 +f
420 +f
421 diff -r d89b0a12d229 -r f8954cd4dc1f g
421 diff -r d89b0a12d229 -r f8954cd4dc1f g
422 --- a/g Thu Jan 01 00:00:02 1970 +0000
422 --- a/g Thu Jan 01 00:00:02 1970 +0000
423 +++ b/g Thu Jan 01 00:00:03 1970 +0000
423 +++ b/g Thu Jan 01 00:00:03 1970 +0000
424 @@ -1,1 +1,2 @@
424 @@ -1,1 +1,2 @@
425 f
425 f
426 +g
426 +g
427
427
428 changeset: 1:d89b0a12d229
428 changeset: 1:d89b0a12d229
429 user: test
429 user: test
430 date: Thu Jan 01 00:00:02 1970 +0000
430 date: Thu Jan 01 00:00:02 1970 +0000
431 summary: b
431 summary: b
432
432
433 diff -r 9161b9aeaf16 -r d89b0a12d229 b
433 diff -r 9161b9aeaf16 -r d89b0a12d229 b
434 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
434 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
435 +++ b/b Thu Jan 01 00:00:02 1970 +0000
435 +++ b/b Thu Jan 01 00:00:02 1970 +0000
436 @@ -0,0 +1,1 @@
436 @@ -0,0 +1,1 @@
437 +a
437 +a
438 diff -r 9161b9aeaf16 -r d89b0a12d229 g
438 diff -r 9161b9aeaf16 -r d89b0a12d229 g
439 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
439 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
440 +++ b/g Thu Jan 01 00:00:02 1970 +0000
440 +++ b/g Thu Jan 01 00:00:02 1970 +0000
441 @@ -0,0 +1,1 @@
441 @@ -0,0 +1,1 @@
442 +f
442 +f
443
443
444 changeset: 0:9161b9aeaf16
444 changeset: 0:9161b9aeaf16
445 user: test
445 user: test
446 date: Thu Jan 01 00:00:01 1970 +0000
446 date: Thu Jan 01 00:00:01 1970 +0000
447 summary: a
447 summary: a
448
448
449 diff -r 000000000000 -r 9161b9aeaf16 a
449 diff -r 000000000000 -r 9161b9aeaf16 a
450 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
450 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
451 +++ b/a Thu Jan 01 00:00:01 1970 +0000
451 +++ b/a Thu Jan 01 00:00:01 1970 +0000
452 @@ -0,0 +1,1 @@
452 @@ -0,0 +1,1 @@
453 +a
453 +a
454 diff -r 000000000000 -r 9161b9aeaf16 f
454 diff -r 000000000000 -r 9161b9aeaf16 f
455 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
455 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
456 +++ b/f Thu Jan 01 00:00:01 1970 +0000
456 +++ b/f Thu Jan 01 00:00:01 1970 +0000
457 @@ -0,0 +1,1 @@
457 @@ -0,0 +1,1 @@
458 +f
458 +f
459
459
460
460
461 log -vf dir/b
461 log -vf dir/b
462
462
463 $ hg log -vf dir/b
463 $ hg log -vf dir/b
464 changeset: 2:f8954cd4dc1f
464 changeset: 2:f8954cd4dc1f
465 user: test
465 user: test
466 date: Thu Jan 01 00:00:03 1970 +0000
466 date: Thu Jan 01 00:00:03 1970 +0000
467 files: b dir/b f g
467 files: b dir/b f g
468 description:
468 description:
469 c
469 c
470
470
471
471
472 changeset: 1:d89b0a12d229
472 changeset: 1:d89b0a12d229
473 user: test
473 user: test
474 date: Thu Jan 01 00:00:02 1970 +0000
474 date: Thu Jan 01 00:00:02 1970 +0000
475 files: b g
475 files: b g
476 description:
476 description:
477 b
477 b
478
478
479
479
480 changeset: 0:9161b9aeaf16
480 changeset: 0:9161b9aeaf16
481 user: test
481 user: test
482 date: Thu Jan 01 00:00:01 1970 +0000
482 date: Thu Jan 01 00:00:01 1970 +0000
483 files: a f
483 files: a f
484 description:
484 description:
485 a
485 a
486
486
487
487
488 Respects ui.logtemplate and command-templates.log configs (the latter takes
488 Respects ui.logtemplate and command-templates.log configs (the latter takes
489 precedence)
489 precedence)
490
490
491 $ hg log -r 0 --config ui.logtemplate="foo {rev}\n"
491 $ hg log -r 0 --config ui.logtemplate="foo {rev}\n"
492 foo 0
492 foo 0
493 $ hg log -r 0 --config command-templates.log="bar {rev}\n"
493 $ hg log -r 0 --config command-templates.log="bar {rev}\n"
494 bar 0
494 bar 0
495 $ hg log -r 0 --config ui.logtemplate="foo {rev}\n" \
495 $ hg log -r 0 --config ui.logtemplate="foo {rev}\n" \
496 > --config command-templates.log="bar {rev}\n"
496 > --config command-templates.log="bar {rev}\n"
497 bar 0
497 bar 0
498
498
499
499
500 -f and multiple filelog heads
500 -f and multiple filelog heads
501
501
502 $ hg up -q 2
502 $ hg up -q 2
503 $ hg log -f g --template '{rev}\n'
503 $ hg log -f g --template '{rev}\n'
504 2
504 2
505 1
505 1
506 0
506 0
507 $ hg up -q tip
507 $ hg up -q tip
508 $ hg log -f g --template '{rev}\n'
508 $ hg log -f g --template '{rev}\n'
509 3
509 3
510 2
510 2
511 0
511 0
512
512
513 follow files from the specified revisions (issue4959)
513 follow files from the specified revisions (issue4959)
514
514
515 $ hg log -G -T '{rev} {files},{file_copies % " {source}->{name}"}\n'
515 $ hg log -G -T '{rev} {files},{file_copies % " {source}->{name}"}\n'
516 @ 4 dir/b e, dir/b->e
516 @ 4 dir/b e, dir/b->e
517 |
517 |
518 o 3 a b d g, a->b f->g
518 o 3 a b d g, a->b f->g
519 |
519 |
520 o 2 b dir/b f g, b->dir/b
520 o 2 b dir/b f g, b->dir/b
521 |
521 |
522 o 1 b g, a->b f->g
522 o 1 b g, a->b f->g
523 |
523 |
524 o 0 a f,
524 o 0 a f,
525
525
526
526
527 $ hg log -T '{rev}\n' -fr 4 e
527 $ hg log -T '{rev}\n' -fr 4 e
528 4
528 4
529 2
529 2
530 1
530 1
531 0
531 0
532 $ hg log -T '{rev}\n' -fr 2 g
532 $ hg log -T '{rev}\n' -fr 2 g
533 2
533 2
534 1
534 1
535 0
535 0
536 $ hg log -T '{rev}\n' -fr '2+3' g
536 $ hg log -T '{rev}\n' -fr '2+3' g
537 3
537 3
538 2
538 2
539 1
539 1
540 0
540 0
541
541
542 follow files from the specified revisions with glob patterns (issue5053)
542 follow files from the specified revisions with glob patterns (issue5053)
543 (BROKEN: should follow copies from e@4)
543 (BROKEN: should follow copies from e@4)
544
544
545 $ hg log -T '{rev}\n' -fr4 e -X '[abcdfg]'
545 $ hg log -T '{rev}\n' -fr4 e -X '[abcdfg]'
546 4
546 4
547 2 (false !)
547 2 (false !)
548 1 (false !)
548 1 (false !)
549 0 (false !)
549 0 (false !)
550
550
551 follow files from the specified revisions with missing patterns
551 follow files from the specified revisions with missing patterns
552
552
553 $ hg log -T '{rev}\n' -fr4 e x
553 $ hg log -T '{rev}\n' -fr4 e x
554 abort: cannot follow file not in any of the specified revisions: "x"
554 abort: cannot follow file not in any of the specified revisions: "x"
555 [20]
555 [20]
556
556
557 follow files from the specified revisions with directory patterns
557 follow files from the specified revisions with directory patterns
558 (BROKEN: should follow copies from dir/b@2)
558 (BROKEN: should follow copies from dir/b@2)
559
559
560 $ hg log -T '{rev}\n' -fr2 dir/b dir
560 $ hg log -T '{rev}\n' -fr2 dir/b dir
561 2
561 2
562 1 (false !)
562 1 (false !)
563 0 (false !)
563 0 (false !)
564
564
565 follow files from multiple revisions, but the pattern is missing in
565 follow files from multiple revisions, but the pattern is missing in
566 one of the specified revisions
566 one of the specified revisions
567
567
568 $ hg log -T '{rev}\n' -fr'2+4' dir/b e
568 $ hg log -T '{rev}\n' -fr'2+4' dir/b e
569 e: no such file in rev f8954cd4dc1f
569 e: no such file in rev f8954cd4dc1f
570 dir/b: no such file in rev 7e4639b4691b
570 dir/b: no such file in rev 7e4639b4691b
571 4
571 4
572 2
572 2
573 1
573 1
574 0
574 0
575
575
576 follow files from multiple revisions, and the pattern matches a file in
576 follow files from multiple revisions, and the pattern matches a file in
577 one revision but matches a directory in another:
577 one revision but matches a directory in another:
578 (BROKEN: should follow copies from dir/b@2 and dir/b/g@5)
578 (BROKEN: should follow copies from dir/b@2 and dir/b/g@5)
579 (BROKEN: the revision 4 should not be included since dir/b/g@5 is unchanged)
579 (BROKEN: the revision 4 should not be included since dir/b/g@5 is unchanged)
580
580
581 $ mkdir -p dir/b
581 $ mkdir -p dir/b
582 $ hg mv g dir/b
582 $ hg mv g dir/b
583 $ hg ci -m 'make dir/b a directory'
583 $ hg ci -m 'make dir/b a directory'
584
584
585 $ hg log -T '{rev}\n' -fr'2+5' dir/b
585 $ hg log -T '{rev}\n' -fr'2+5' dir/b
586 5
586 5
587 4
587 4
588 3 (false !)
588 3 (false !)
589 2
589 2
590 1 (false !)
590 1 (false !)
591 0 (false !)
591 0 (false !)
592
592
593 $ hg --config extensions.strip= strip -r. --no-backup
593 $ hg --config extensions.strip= strip -r. --no-backup
594 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
594 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
595
595
596 follow files from the specified revisions across copies with -p/--patch
596 follow files from the specified revisions across copies with -p/--patch
597
597
598 $ hg log -T '== rev: {rev},{file_copies % " {source}->{name}"} ==\n' -fpr 4 e g
598 $ hg log -T '== rev: {rev},{file_copies % " {source}->{name}"} ==\n' -fpr 4 e g
599 == rev: 4, dir/b->e ==
599 == rev: 4, dir/b->e ==
600 diff -r 2ca5ba701980 -r 7e4639b4691b e
600 diff -r 2ca5ba701980 -r 7e4639b4691b e
601 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
601 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
602 +++ b/e Thu Jan 01 00:00:05 1970 +0000
602 +++ b/e Thu Jan 01 00:00:05 1970 +0000
603 @@ -0,0 +1,1 @@
603 @@ -0,0 +1,1 @@
604 +a
604 +a
605
605
606 == rev: 3, a->b f->g ==
606 == rev: 3, a->b f->g ==
607 diff -r f8954cd4dc1f -r 2ca5ba701980 g
607 diff -r f8954cd4dc1f -r 2ca5ba701980 g
608 --- a/g Thu Jan 01 00:00:03 1970 +0000
608 --- a/g Thu Jan 01 00:00:03 1970 +0000
609 +++ b/g Thu Jan 01 00:00:04 1970 +0000
609 +++ b/g Thu Jan 01 00:00:04 1970 +0000
610 @@ -1,2 +1,2 @@
610 @@ -1,2 +1,2 @@
611 f
611 f
612 -g
612 -g
613 +f
613 +f
614
614
615 == rev: 2, b->dir/b ==
615 == rev: 2, b->dir/b ==
616 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
616 diff -r d89b0a12d229 -r f8954cd4dc1f dir/b
617 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
617 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
618 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
618 +++ b/dir/b Thu Jan 01 00:00:03 1970 +0000
619 @@ -0,0 +1,1 @@
619 @@ -0,0 +1,1 @@
620 +a
620 +a
621 diff -r d89b0a12d229 -r f8954cd4dc1f f
621 diff -r d89b0a12d229 -r f8954cd4dc1f f
622 --- a/f Thu Jan 01 00:00:02 1970 +0000
622 --- a/f Thu Jan 01 00:00:02 1970 +0000
623 +++ b/f Thu Jan 01 00:00:03 1970 +0000
623 +++ b/f Thu Jan 01 00:00:03 1970 +0000
624 @@ -1,1 +1,2 @@
624 @@ -1,1 +1,2 @@
625 f
625 f
626 +f
626 +f
627
627
628 == rev: 1, a->b f->g ==
628 == rev: 1, a->b f->g ==
629 diff -r 9161b9aeaf16 -r d89b0a12d229 b
629 diff -r 9161b9aeaf16 -r d89b0a12d229 b
630 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
630 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
631 +++ b/b Thu Jan 01 00:00:02 1970 +0000
631 +++ b/b Thu Jan 01 00:00:02 1970 +0000
632 @@ -0,0 +1,1 @@
632 @@ -0,0 +1,1 @@
633 +a
633 +a
634
634
635 == rev: 0, ==
635 == rev: 0, ==
636 diff -r 000000000000 -r 9161b9aeaf16 a
636 diff -r 000000000000 -r 9161b9aeaf16 a
637 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
637 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
638 +++ b/a Thu Jan 01 00:00:01 1970 +0000
638 +++ b/a Thu Jan 01 00:00:01 1970 +0000
639 @@ -0,0 +1,1 @@
639 @@ -0,0 +1,1 @@
640 +a
640 +a
641 diff -r 000000000000 -r 9161b9aeaf16 f
641 diff -r 000000000000 -r 9161b9aeaf16 f
642 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
642 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
643 +++ b/f Thu Jan 01 00:00:01 1970 +0000
643 +++ b/f Thu Jan 01 00:00:01 1970 +0000
644 @@ -0,0 +1,1 @@
644 @@ -0,0 +1,1 @@
645 +f
645 +f
646
646
647
647
648 log copies with --copies
648 log copies with --copies
649
649
650 $ hg log -vC --template '{rev} {file_copies}\n'
650 $ hg log -vC --template '{rev} {file_copies}\n'
651 4 e (dir/b)
651 4 e (dir/b)
652 3 b (a)g (f)
652 3 b (a)g (f)
653 2 dir/b (b)
653 2 dir/b (b)
654 1 b (a)g (f)
654 1 b (a)g (f)
655 0
655 0
656
656
657 log copies switch without --copies, with old filecopy template
657 log copies switch without --copies, with old filecopy template
658
658
659 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
659 $ hg log -v --template '{rev} {file_copies_switch%filecopy}\n'
660 4
660 4
661 3
661 3
662 2
662 2
663 1
663 1
664 0
664 0
665
665
666 log copies switch with --copies
666 log copies switch with --copies
667
667
668 $ hg log -vC --template '{rev} {file_copies_switch}\n'
668 $ hg log -vC --template '{rev} {file_copies_switch}\n'
669 4 e (dir/b)
669 4 e (dir/b)
670 3 b (a)g (f)
670 3 b (a)g (f)
671 2 dir/b (b)
671 2 dir/b (b)
672 1 b (a)g (f)
672 1 b (a)g (f)
673 0
673 0
674
674
675
675
676 log copies with hardcoded style and with --style=default
676 log copies with hardcoded style and with --style=default
677
677
678 $ hg log -vC -r4
678 $ hg log -vC -r4
679 changeset: 4:7e4639b4691b
679 changeset: 4:7e4639b4691b
680 tag: tip
680 tag: tip
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:05 1970 +0000
682 date: Thu Jan 01 00:00:05 1970 +0000
683 files: dir/b e
683 files: dir/b e
684 copies: e (dir/b)
684 copies: e (dir/b)
685 description:
685 description:
686 e
686 e
687
687
688
688
689 $ hg log -vC -r4 --style=default
689 $ hg log -vC -r4 --style=default
690 changeset: 4:7e4639b4691b
690 changeset: 4:7e4639b4691b
691 tag: tip
691 tag: tip
692 user: test
692 user: test
693 date: Thu Jan 01 00:00:05 1970 +0000
693 date: Thu Jan 01 00:00:05 1970 +0000
694 files: dir/b e
694 files: dir/b e
695 copies: e (dir/b)
695 copies: e (dir/b)
696 description:
696 description:
697 e
697 e
698
698
699
699
700 $ hg log -vC -r4 -Tjson
700 $ hg log -vC -r4 -Tjson
701 [
701 [
702 {
702 {
703 "bookmarks": [],
703 "bookmarks": [],
704 "branch": "default",
704 "branch": "default",
705 "copies": {"e": "dir/b"},
705 "copies": {"e": "dir/b"},
706 "date": [5, 0],
706 "date": [5, 0],
707 "desc": "e",
707 "desc": "e",
708 "files": ["dir/b", "e"],
708 "files": ["dir/b", "e"],
709 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
709 "node": "7e4639b4691b9f84b81036a8d4fb218ce3c5e3a3",
710 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
710 "parents": ["2ca5ba7019804f1f597249caddf22a64d34df0ba"],
711 "phase": "draft",
711 "phase": "draft",
712 "rev": 4,
712 "rev": 4,
713 "tags": ["tip"],
713 "tags": ["tip"],
714 "user": "test"
714 "user": "test"
715 }
715 }
716 ]
716 ]
717
717
718 log copies, non-linear manifest
718 log copies, non-linear manifest
719
719
720 $ hg up -C 3
720 $ hg up -C 3
721 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
721 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
722 $ hg mv dir/b e
722 $ hg mv dir/b e
723 $ echo foo > foo
723 $ echo foo > foo
724 $ hg ci -Ame2 -d '6 0'
724 $ hg ci -Ame2 -d '6 0'
725 adding foo
725 adding foo
726 created new head
726 created new head
727 $ hg log -v --template '{rev} {file_copies}\n' -r 5
727 $ hg log -v --template '{rev} {file_copies}\n' -r 5
728 5 e (dir/b)
728 5 e (dir/b)
729
729
730
730
731 log copies, execute bit set
731 log copies, execute bit set
732
732
733 #if execbit
733 #if execbit
734 $ chmod +x e
734 $ chmod +x e
735 $ hg ci -me3 -d '7 0'
735 $ hg ci -me3 -d '7 0'
736 $ hg log -v --template '{rev} {file_copies}\n' -r 6
736 $ hg log -v --template '{rev} {file_copies}\n' -r 6
737 6
737 6
738 #endif
738 #endif
739
739
740 log copies, empty set
740 log copies, empty set
741
741
742 $ hg log --copies -r '0 and not 0'
742 $ hg log --copies -r '0 and not 0'
743
743
744 log -p d
744 log -p d
745
745
746 $ hg log -pv d
746 $ hg log -pv d
747 changeset: 3:2ca5ba701980
747 changeset: 3:2ca5ba701980
748 user: test
748 user: test
749 date: Thu Jan 01 00:00:04 1970 +0000
749 date: Thu Jan 01 00:00:04 1970 +0000
750 files: a b d g
750 files: a b d g
751 description:
751 description:
752 d
752 d
753
753
754
754
755 diff -r f8954cd4dc1f -r 2ca5ba701980 d
755 diff -r f8954cd4dc1f -r 2ca5ba701980 d
756 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
756 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
757 +++ b/d Thu Jan 01 00:00:04 1970 +0000
757 +++ b/d Thu Jan 01 00:00:04 1970 +0000
758 @@ -0,0 +1,1 @@
758 @@ -0,0 +1,1 @@
759 +a
759 +a
760
760
761
761
762
762
763 log --removed file
763 log --removed file
764
764
765 $ hg log --removed -v a
765 $ hg log --removed -v a
766 changeset: 3:2ca5ba701980
766 changeset: 3:2ca5ba701980
767 user: test
767 user: test
768 date: Thu Jan 01 00:00:04 1970 +0000
768 date: Thu Jan 01 00:00:04 1970 +0000
769 files: a b d g
769 files: a b d g
770 description:
770 description:
771 d
771 d
772
772
773
773
774 changeset: 0:9161b9aeaf16
774 changeset: 0:9161b9aeaf16
775 user: test
775 user: test
776 date: Thu Jan 01 00:00:01 1970 +0000
776 date: Thu Jan 01 00:00:01 1970 +0000
777 files: a f
777 files: a f
778 description:
778 description:
779 a
779 a
780
780
781
781
782
782
783 log --removed revrange file
783 log --removed revrange file
784
784
785 $ hg log --removed -v -r0:2 a
785 $ hg log --removed -v -r0:2 a
786 changeset: 0:9161b9aeaf16
786 changeset: 0:9161b9aeaf16
787 user: test
787 user: test
788 date: Thu Jan 01 00:00:01 1970 +0000
788 date: Thu Jan 01 00:00:01 1970 +0000
789 files: a f
789 files: a f
790 description:
790 description:
791 a
791 a
792
792
793
793
794 $ cd ..
794 $ cd ..
795
795
796 log --follow tests
796 log --follow tests
797
797
798 $ hg init follow
798 $ hg init follow
799 $ cd follow
799 $ cd follow
800
800
801 $ echo base > base
801 $ echo base > base
802 $ hg ci -Ambase -d '1 0'
802 $ hg ci -Ambase -d '1 0'
803 adding base
803 adding base
804
804
805 $ echo r1 >> base
805 $ echo r1 >> base
806 $ hg ci -Amr1 -d '1 0'
806 $ hg ci -Amr1 -d '1 0'
807 $ echo r2 >> base
807 $ echo r2 >> base
808 $ hg ci -Amr2 -d '1 0'
808 $ hg ci -Amr2 -d '1 0'
809
809
810 $ hg up -C 1
810 $ hg up -C 1
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
812 $ echo b1 > b1
812 $ echo b1 > b1
813
813
814 log -r "follow('set:clean()')"
814 log -r "follow('set:clean()')"
815
815
816 $ hg log -r "follow('set:clean()')"
816 $ hg log -r "follow('set:clean()')"
817 changeset: 0:67e992f2c4f3
817 changeset: 0:67e992f2c4f3
818 user: test
818 user: test
819 date: Thu Jan 01 00:00:01 1970 +0000
819 date: Thu Jan 01 00:00:01 1970 +0000
820 summary: base
820 summary: base
821
821
822 changeset: 1:3d5bf5654eda
822 changeset: 1:3d5bf5654eda
823 user: test
823 user: test
824 date: Thu Jan 01 00:00:01 1970 +0000
824 date: Thu Jan 01 00:00:01 1970 +0000
825 summary: r1
825 summary: r1
826
826
827
827
828 $ hg ci -Amb1 -d '1 0'
828 $ hg ci -Amb1 -d '1 0'
829 adding b1
829 adding b1
830 created new head
830 created new head
831
831
832
832
833 log -f
833 log -f
834
834
835 $ hg log -f
835 $ hg log -f
836 changeset: 3:e62f78d544b4
836 changeset: 3:e62f78d544b4
837 tag: tip
837 tag: tip
838 parent: 1:3d5bf5654eda
838 parent: 1:3d5bf5654eda
839 user: test
839 user: test
840 date: Thu Jan 01 00:00:01 1970 +0000
840 date: Thu Jan 01 00:00:01 1970 +0000
841 summary: b1
841 summary: b1
842
842
843 changeset: 1:3d5bf5654eda
843 changeset: 1:3d5bf5654eda
844 user: test
844 user: test
845 date: Thu Jan 01 00:00:01 1970 +0000
845 date: Thu Jan 01 00:00:01 1970 +0000
846 summary: r1
846 summary: r1
847
847
848 changeset: 0:67e992f2c4f3
848 changeset: 0:67e992f2c4f3
849 user: test
849 user: test
850 date: Thu Jan 01 00:00:01 1970 +0000
850 date: Thu Jan 01 00:00:01 1970 +0000
851 summary: base
851 summary: base
852
852
853
853
854 log -r follow('glob:b*')
854 log -r follow('glob:b*')
855
855
856 $ hg log -r "follow('glob:b*')"
856 $ hg log -r "follow('glob:b*')"
857 changeset: 0:67e992f2c4f3
857 changeset: 0:67e992f2c4f3
858 user: test
858 user: test
859 date: Thu Jan 01 00:00:01 1970 +0000
859 date: Thu Jan 01 00:00:01 1970 +0000
860 summary: base
860 summary: base
861
861
862 changeset: 1:3d5bf5654eda
862 changeset: 1:3d5bf5654eda
863 user: test
863 user: test
864 date: Thu Jan 01 00:00:01 1970 +0000
864 date: Thu Jan 01 00:00:01 1970 +0000
865 summary: r1
865 summary: r1
866
866
867 changeset: 3:e62f78d544b4
867 changeset: 3:e62f78d544b4
868 tag: tip
868 tag: tip
869 parent: 1:3d5bf5654eda
869 parent: 1:3d5bf5654eda
870 user: test
870 user: test
871 date: Thu Jan 01 00:00:01 1970 +0000
871 date: Thu Jan 01 00:00:01 1970 +0000
872 summary: b1
872 summary: b1
873
873
874 log -f -r '1 + 4'
874 log -f -r '1 + 4'
875
875
876 $ hg up -C 0
876 $ hg up -C 0
877 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
877 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
878 $ echo b2 > b2
878 $ echo b2 > b2
879 $ hg ci -Amb2 -d '1 0'
879 $ hg ci -Amb2 -d '1 0'
880 adding b2
880 adding b2
881 created new head
881 created new head
882 $ hg log -f -r '1 + 4'
882 $ hg log -f -r '1 + 4'
883 changeset: 4:ddb82e70d1a1
883 changeset: 4:ddb82e70d1a1
884 tag: tip
884 tag: tip
885 parent: 0:67e992f2c4f3
885 parent: 0:67e992f2c4f3
886 user: test
886 user: test
887 date: Thu Jan 01 00:00:01 1970 +0000
887 date: Thu Jan 01 00:00:01 1970 +0000
888 summary: b2
888 summary: b2
889
889
890 changeset: 1:3d5bf5654eda
890 changeset: 1:3d5bf5654eda
891 user: test
891 user: test
892 date: Thu Jan 01 00:00:01 1970 +0000
892 date: Thu Jan 01 00:00:01 1970 +0000
893 summary: r1
893 summary: r1
894
894
895 changeset: 0:67e992f2c4f3
895 changeset: 0:67e992f2c4f3
896 user: test
896 user: test
897 date: Thu Jan 01 00:00:01 1970 +0000
897 date: Thu Jan 01 00:00:01 1970 +0000
898 summary: base
898 summary: base
899
899
900
900
901 log -fr with aliases: 'A' should be expanded, but 'reverse()' should have no
901 log -fr with aliases: 'A' should be expanded, but 'reverse()' should have no
902 effect
902 effect
903
903
904 $ hg log --config 'revsetalias.reverse(x)=x' --config 'revsetalias.A=1+4' -qfrA
904 $ hg log --config 'revsetalias.reverse(x)=x' --config 'revsetalias.A=1+4' -qfrA
905 4:ddb82e70d1a1
905 4:ddb82e70d1a1
906 1:3d5bf5654eda
906 1:3d5bf5654eda
907 0:67e992f2c4f3
907 0:67e992f2c4f3
908
908
909 log -r "follow('set:grep(b2)')"
909 log -r "follow('set:grep(b2)')"
910
910
911 $ hg log -r "follow('set:grep(b2)')"
911 $ hg log -r "follow('set:grep(b2)')"
912 changeset: 4:ddb82e70d1a1
912 changeset: 4:ddb82e70d1a1
913 tag: tip
913 tag: tip
914 parent: 0:67e992f2c4f3
914 parent: 0:67e992f2c4f3
915 user: test
915 user: test
916 date: Thu Jan 01 00:00:01 1970 +0000
916 date: Thu Jan 01 00:00:01 1970 +0000
917 summary: b2
917 summary: b2
918
918
919 log -r "follow('set:grep(b2)', 4)"
919 log -r "follow('set:grep(b2)', 4)"
920
920
921 $ hg up -qC 0
921 $ hg up -qC 0
922 $ hg log -r "follow('set:grep(b2)', 4)"
922 $ hg log -r "follow('set:grep(b2)', 4)"
923 changeset: 4:ddb82e70d1a1
923 changeset: 4:ddb82e70d1a1
924 tag: tip
924 tag: tip
925 parent: 0:67e992f2c4f3
925 parent: 0:67e992f2c4f3
926 user: test
926 user: test
927 date: Thu Jan 01 00:00:01 1970 +0000
927 date: Thu Jan 01 00:00:01 1970 +0000
928 summary: b2
928 summary: b2
929
929
930
930
931 follow files starting from multiple revisions:
931 follow files starting from multiple revisions:
932
932
933 $ hg log -T '{rev}: {files}\n' -r "follow('glob:b?', startrev=2+3+4)"
933 $ hg log -T '{rev}: {files}\n' -r "follow('glob:b?', startrev=2+3+4)"
934 3: b1
934 3: b1
935 4: b2
935 4: b2
936
936
937 follow files starting from empty revision:
937 follow files starting from empty revision:
938
938
939 $ hg log -T '{rev}: {files}\n' -r "follow('glob:*', startrev=.-.)"
939 $ hg log -T '{rev}: {files}\n' -r "follow('glob:*', startrev=.-.)"
940
940
941 follow starting from revisions:
941 follow starting from revisions:
942
942
943 $ hg log -Gq -r "follow(startrev=2+4)"
943 $ hg log -Gq -r "follow(startrev=2+4)"
944 o 4:ddb82e70d1a1
944 o 4:ddb82e70d1a1
945 |
945 |
946 | o 2:60c670bf5b30
946 | o 2:60c670bf5b30
947 | |
947 | |
948 | o 1:3d5bf5654eda
948 | o 1:3d5bf5654eda
949 |/
949 |/
950 @ 0:67e992f2c4f3
950 @ 0:67e992f2c4f3
951
951
952
952
953 follow the current revision:
953 follow the current revision:
954
954
955 $ hg log -Gq -r "follow()"
955 $ hg log -Gq -r "follow()"
956 @ 0:67e992f2c4f3
956 @ 0:67e992f2c4f3
957
957
958
958
959 $ hg up -qC 4
959 $ hg up -qC 4
960
960
961 log -f -r null
961 log -f -r null
962
962
963 $ hg log -f -r null
963 $ hg log -f -r null
964 changeset: -1:000000000000
964 changeset: -1:000000000000
965 user:
965 user:
966 date: Thu Jan 01 00:00:00 1970 +0000
966 date: Thu Jan 01 00:00:00 1970 +0000
967
967
968 $ hg log -f -r null -G
968 $ hg log -f -r null -G
969 o changeset: -1:000000000000
969 o changeset: -1:000000000000
970 user:
970 user:
971 date: Thu Jan 01 00:00:00 1970 +0000
971 date: Thu Jan 01 00:00:00 1970 +0000
972
972
973
973
974
974
975 log -f with null parent
975 log -f with null parent
976
976
977 $ hg up -C null
977 $ hg up -C null
978 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
978 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
979 $ hg log -f
979 $ hg log -f
980
980
981
981
982 log -r . with two parents
982 log -r . with two parents
983
983
984 $ hg up -C 3
984 $ hg up -C 3
985 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
985 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
986 $ hg merge tip
986 $ hg merge tip
987 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
987 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
988 (branch merge, don't forget to commit)
988 (branch merge, don't forget to commit)
989 $ hg log -r .
989 $ hg log -r .
990 changeset: 3:e62f78d544b4
990 changeset: 3:e62f78d544b4
991 parent: 1:3d5bf5654eda
991 parent: 1:3d5bf5654eda
992 user: test
992 user: test
993 date: Thu Jan 01 00:00:01 1970 +0000
993 date: Thu Jan 01 00:00:01 1970 +0000
994 summary: b1
994 summary: b1
995
995
996
996
997
997
998 log -r . with one parent
998 log -r . with one parent
999
999
1000 $ hg ci -mm12 -d '1 0'
1000 $ hg ci -mm12 -d '1 0'
1001 $ hg log -r .
1001 $ hg log -r .
1002 changeset: 5:302e9dd6890d
1002 changeset: 5:302e9dd6890d
1003 tag: tip
1003 tag: tip
1004 parent: 3:e62f78d544b4
1004 parent: 3:e62f78d544b4
1005 parent: 4:ddb82e70d1a1
1005 parent: 4:ddb82e70d1a1
1006 user: test
1006 user: test
1007 date: Thu Jan 01 00:00:01 1970 +0000
1007 date: Thu Jan 01 00:00:01 1970 +0000
1008 summary: m12
1008 summary: m12
1009
1009
1010
1010
1011 $ echo postm >> b1
1011 $ echo postm >> b1
1012 $ hg ci -Amb1.1 -d'1 0'
1012 $ hg ci -Amb1.1 -d'1 0'
1013
1013
1014
1014
1015 log --follow-first
1015 log --follow-first
1016
1016
1017 $ hg log --follow-first
1017 $ hg log --follow-first
1018 changeset: 6:2404bbcab562
1018 changeset: 6:2404bbcab562
1019 tag: tip
1019 tag: tip
1020 user: test
1020 user: test
1021 date: Thu Jan 01 00:00:01 1970 +0000
1021 date: Thu Jan 01 00:00:01 1970 +0000
1022 summary: b1.1
1022 summary: b1.1
1023
1023
1024 changeset: 5:302e9dd6890d
1024 changeset: 5:302e9dd6890d
1025 parent: 3:e62f78d544b4
1025 parent: 3:e62f78d544b4
1026 parent: 4:ddb82e70d1a1
1026 parent: 4:ddb82e70d1a1
1027 user: test
1027 user: test
1028 date: Thu Jan 01 00:00:01 1970 +0000
1028 date: Thu Jan 01 00:00:01 1970 +0000
1029 summary: m12
1029 summary: m12
1030
1030
1031 changeset: 3:e62f78d544b4
1031 changeset: 3:e62f78d544b4
1032 parent: 1:3d5bf5654eda
1032 parent: 1:3d5bf5654eda
1033 user: test
1033 user: test
1034 date: Thu Jan 01 00:00:01 1970 +0000
1034 date: Thu Jan 01 00:00:01 1970 +0000
1035 summary: b1
1035 summary: b1
1036
1036
1037 changeset: 1:3d5bf5654eda
1037 changeset: 1:3d5bf5654eda
1038 user: test
1038 user: test
1039 date: Thu Jan 01 00:00:01 1970 +0000
1039 date: Thu Jan 01 00:00:01 1970 +0000
1040 summary: r1
1040 summary: r1
1041
1041
1042 changeset: 0:67e992f2c4f3
1042 changeset: 0:67e992f2c4f3
1043 user: test
1043 user: test
1044 date: Thu Jan 01 00:00:01 1970 +0000
1044 date: Thu Jan 01 00:00:01 1970 +0000
1045 summary: base
1045 summary: base
1046
1046
1047
1047
1048
1048
1049 log -P 2
1049 log -P 2
1050
1050
1051 $ hg log -P 2
1051 $ hg log -P 2
1052 changeset: 6:2404bbcab562
1052 changeset: 6:2404bbcab562
1053 tag: tip
1053 tag: tip
1054 user: test
1054 user: test
1055 date: Thu Jan 01 00:00:01 1970 +0000
1055 date: Thu Jan 01 00:00:01 1970 +0000
1056 summary: b1.1
1056 summary: b1.1
1057
1057
1058 changeset: 5:302e9dd6890d
1058 changeset: 5:302e9dd6890d
1059 parent: 3:e62f78d544b4
1059 parent: 3:e62f78d544b4
1060 parent: 4:ddb82e70d1a1
1060 parent: 4:ddb82e70d1a1
1061 user: test
1061 user: test
1062 date: Thu Jan 01 00:00:01 1970 +0000
1062 date: Thu Jan 01 00:00:01 1970 +0000
1063 summary: m12
1063 summary: m12
1064
1064
1065 changeset: 4:ddb82e70d1a1
1065 changeset: 4:ddb82e70d1a1
1066 parent: 0:67e992f2c4f3
1066 parent: 0:67e992f2c4f3
1067 user: test
1067 user: test
1068 date: Thu Jan 01 00:00:01 1970 +0000
1068 date: Thu Jan 01 00:00:01 1970 +0000
1069 summary: b2
1069 summary: b2
1070
1070
1071 changeset: 3:e62f78d544b4
1071 changeset: 3:e62f78d544b4
1072 parent: 1:3d5bf5654eda
1072 parent: 1:3d5bf5654eda
1073 user: test
1073 user: test
1074 date: Thu Jan 01 00:00:01 1970 +0000
1074 date: Thu Jan 01 00:00:01 1970 +0000
1075 summary: b1
1075 summary: b1
1076
1076
1077
1077
1078
1078
1079 log -r tip -p --git
1079 log -r tip -p --git
1080
1080
1081 $ hg log -r tip -p --git
1081 $ hg log -r tip -p --git
1082 changeset: 6:2404bbcab562
1082 changeset: 6:2404bbcab562
1083 tag: tip
1083 tag: tip
1084 user: test
1084 user: test
1085 date: Thu Jan 01 00:00:01 1970 +0000
1085 date: Thu Jan 01 00:00:01 1970 +0000
1086 summary: b1.1
1086 summary: b1.1
1087
1087
1088 diff --git a/b1 b/b1
1088 diff --git a/b1 b/b1
1089 --- a/b1
1089 --- a/b1
1090 +++ b/b1
1090 +++ b/b1
1091 @@ -1,1 +1,2 @@
1091 @@ -1,1 +1,2 @@
1092 b1
1092 b1
1093 +postm
1093 +postm
1094
1094
1095
1095
1096
1096
1097 log -r ""
1097 log -r ""
1098
1098
1099 $ hg log -r ''
1099 $ hg log -r ''
1100 hg: parse error: empty query
1100 hg: parse error: empty query
1101 [10]
1101 [10]
1102
1102
1103 log -r <some unknown node id>
1103 log -r <some unknown node id>
1104
1104
1105 $ hg log -r 1000000000000000000000000000000000000000
1105 $ hg log -r 1000000000000000000000000000000000000000
1106 abort: unknown revision '1000000000000000000000000000000000000000'
1106 abort: unknown revision '1000000000000000000000000000000000000000'
1107 [10]
1107 [10]
1108
1108
1109 log -k r1
1109 log -k r1
1110
1110
1111 $ hg log -k r1
1111 $ hg log -k r1
1112 changeset: 1:3d5bf5654eda
1112 changeset: 1:3d5bf5654eda
1113 user: test
1113 user: test
1114 date: Thu Jan 01 00:00:01 1970 +0000
1114 date: Thu Jan 01 00:00:01 1970 +0000
1115 summary: r1
1115 summary: r1
1116
1116
1117 log -p -l2 --color=always
1117 log -p -l2 --color=always
1118
1118
1119 $ hg --config extensions.color= --config color.mode=ansi \
1119 $ hg --config extensions.color= --config color.mode=ansi \
1120 > log -p -l2 --color=always
1120 > log -p -l2 --color=always
1121 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
1121 \x1b[0;33mchangeset: 6:2404bbcab562\x1b[0m (esc)
1122 tag: tip
1122 tag: tip
1123 user: test
1123 user: test
1124 date: Thu Jan 01 00:00:01 1970 +0000
1124 date: Thu Jan 01 00:00:01 1970 +0000
1125 summary: b1.1
1125 summary: b1.1
1126
1126
1127 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
1127 \x1b[0;1mdiff -r 302e9dd6890d -r 2404bbcab562 b1\x1b[0m (esc)
1128 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1128 \x1b[0;31;1m--- a/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1129 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1129 \x1b[0;32;1m+++ b/b1 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1130 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
1130 \x1b[0;35m@@ -1,1 +1,2 @@\x1b[0m (esc)
1131 b1
1131 b1
1132 \x1b[0;32m+postm\x1b[0m (esc)
1132 \x1b[0;32m+postm\x1b[0m (esc)
1133
1133
1134 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
1134 \x1b[0;33mchangeset: 5:302e9dd6890d\x1b[0m (esc)
1135 parent: 3:e62f78d544b4
1135 parent: 3:e62f78d544b4
1136 parent: 4:ddb82e70d1a1
1136 parent: 4:ddb82e70d1a1
1137 user: test
1137 user: test
1138 date: Thu Jan 01 00:00:01 1970 +0000
1138 date: Thu Jan 01 00:00:01 1970 +0000
1139 summary: m12
1139 summary: m12
1140
1140
1141 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
1141 \x1b[0;1mdiff -r e62f78d544b4 -r 302e9dd6890d b2\x1b[0m (esc)
1142 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
1142 \x1b[0;31;1m--- /dev/null Thu Jan 01 00:00:00 1970 +0000\x1b[0m (esc)
1143 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1143 \x1b[0;32;1m+++ b/b2 Thu Jan 01 00:00:01 1970 +0000\x1b[0m (esc)
1144 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
1144 \x1b[0;35m@@ -0,0 +1,1 @@\x1b[0m (esc)
1145 \x1b[0;32m+b2\x1b[0m (esc)
1145 \x1b[0;32m+b2\x1b[0m (esc)
1146
1146
1147
1147
1148
1148
1149 log -r tip --stat
1149 log -r tip --stat
1150
1150
1151 $ hg log -r tip --stat
1151 $ hg log -r tip --stat
1152 changeset: 6:2404bbcab562
1152 changeset: 6:2404bbcab562
1153 tag: tip
1153 tag: tip
1154 user: test
1154 user: test
1155 date: Thu Jan 01 00:00:01 1970 +0000
1155 date: Thu Jan 01 00:00:01 1970 +0000
1156 summary: b1.1
1156 summary: b1.1
1157
1157
1158 b1 | 1 +
1158 b1 | 1 +
1159 1 files changed, 1 insertions(+), 0 deletions(-)
1159 1 files changed, 1 insertions(+), 0 deletions(-)
1160
1160
1161
1161
1162 $ cd ..
1162 $ cd ..
1163
1163
1164 log --follow --patch FILE in repository where linkrev isn't trustworthy
1164 log --follow --patch FILE in repository where linkrev isn't trustworthy
1165 (issue5376, issue6124)
1165 (issue5376, issue6124)
1166
1166
1167 $ hg init follow-dup
1167 $ hg init follow-dup
1168 $ cd follow-dup
1168 $ cd follow-dup
1169 $ cat <<EOF >> .hg/hgrc
1169 $ cat <<EOF >> .hg/hgrc
1170 > [command-templates]
1170 > [command-templates]
1171 > log = '=== {rev}: {desc}\n'
1171 > log = '=== {rev}: {desc}\n'
1172 > [diff]
1172 > [diff]
1173 > nodates = True
1173 > nodates = True
1174 > EOF
1174 > EOF
1175 $ echo 0 >> a
1175 $ echo 0 >> a
1176 $ hg ci -qAm 'a0'
1176 $ hg ci -qAm 'a0'
1177 $ echo 1 >> a
1177 $ echo 1 >> a
1178 $ hg ci -m 'a1'
1178 $ hg ci -m 'a1'
1179 $ hg up -q 0
1179 $ hg up -q 0
1180 $ echo 1 >> a
1180 $ echo 1 >> a
1181 $ touch b
1181 $ touch b
1182 $ hg ci -qAm 'a1 with b'
1182 $ hg ci -qAm 'a1 with b'
1183 $ echo 3 >> a
1183 $ echo 3 >> a
1184 $ hg ci -m 'a3'
1184 $ hg ci -m 'a3'
1185
1185
1186 fctx.rev() == 2, but fctx.linkrev() == 1
1186 fctx.rev() == 2, but fctx.linkrev() == 1
1187
1187
1188 $ hg log -pf a
1188 $ hg log -pf a
1189 === 3: a3
1189 === 3: a3
1190 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
1190 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
1191 --- a/a
1191 --- a/a
1192 +++ b/a
1192 +++ b/a
1193 @@ -1,2 +1,3 @@
1193 @@ -1,2 +1,3 @@
1194 0
1194 0
1195 1
1195 1
1196 +3
1196 +3
1197
1197
1198 === 2: a1 with b
1198 === 2: a1 with b
1199 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1199 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1200 --- a/a
1200 --- a/a
1201 +++ b/a
1201 +++ b/a
1202 @@ -1,1 +1,2 @@
1202 @@ -1,1 +1,2 @@
1203 0
1203 0
1204 +1
1204 +1
1205
1205
1206 === 0: a0
1206 === 0: a0
1207 diff -r 000000000000 -r 49b5e81287e2 a
1207 diff -r 000000000000 -r 49b5e81287e2 a
1208 --- /dev/null
1208 --- /dev/null
1209 +++ b/a
1209 +++ b/a
1210 @@ -0,0 +1,1 @@
1210 @@ -0,0 +1,1 @@
1211 +0
1211 +0
1212
1212
1213 $ hg log -pr . a
1213 $ hg log -pr . a
1214 === 3: a3
1214 === 3: a3
1215 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
1215 diff -r 4ea02ba94d66 -r e7a6331a34f0 a
1216 --- a/a
1216 --- a/a
1217 +++ b/a
1217 +++ b/a
1218 @@ -1,2 +1,3 @@
1218 @@ -1,2 +1,3 @@
1219 0
1219 0
1220 1
1220 1
1221 +3
1221 +3
1222
1222
1223
1223
1224 fctx.introrev() == 2, but fctx.linkrev() == 1
1224 fctx.introrev() == 2, but fctx.linkrev() == 1
1225
1225
1226 $ hg up -q 2
1226 $ hg up -q 2
1227 $ hg log -pf a
1227 $ hg log -pf a
1228 === 2: a1 with b
1228 === 2: a1 with b
1229 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1229 diff -r 49b5e81287e2 -r 4ea02ba94d66 a
1230 --- a/a
1230 --- a/a
1231 +++ b/a
1231 +++ b/a
1232 @@ -1,1 +1,2 @@
1232 @@ -1,1 +1,2 @@
1233 0
1233 0
1234 +1
1234 +1
1235
1235
1236 === 0: a0
1236 === 0: a0
1237 diff -r 000000000000 -r 49b5e81287e2 a
1237 diff -r 000000000000 -r 49b5e81287e2 a
1238 --- /dev/null
1238 --- /dev/null
1239 +++ b/a
1239 +++ b/a
1240 @@ -0,0 +1,1 @@
1240 @@ -0,0 +1,1 @@
1241 +0
1241 +0
1242
1242
1243
1243
1244 BROKEN: should show the same diff as for rev 2 above
1244 BROKEN: should show the same diff as for rev 2 above
1245 $ hg log -pr . a
1245 $ hg log -pr . a
1246
1246
1247 $ cd ..
1247 $ cd ..
1248
1248
1249 Multiple copy sources of a file:
1249 Multiple copy sources of a file:
1250
1250
1251 $ hg init follow-multi
1251 $ hg init follow-multi
1252 $ cd follow-multi
1252 $ cd follow-multi
1253 $ echo 0 >> a
1253 $ echo 0 >> a
1254 $ hg ci -qAm 'a'
1254 $ hg ci -qAm 'a'
1255 $ hg cp a b
1255 $ hg cp a b
1256 $ hg ci -m 'a->b'
1256 $ hg ci -m 'a->b'
1257 $ echo 2 >> a
1257 $ echo 2 >> a
1258 $ hg ci -m 'a'
1258 $ hg ci -m 'a'
1259 $ echo 3 >> b
1259 $ echo 3 >> b
1260 $ hg ci -m 'b'
1260 $ hg ci -m 'b'
1261 $ echo 4 >> a
1261 $ echo 4 >> a
1262 $ echo 4 >> b
1262 $ echo 4 >> b
1263 $ hg ci -m 'a,b'
1263 $ hg ci -m 'a,b'
1264 $ echo 5 >> a
1264 $ echo 5 >> a
1265 $ hg ci -m 'a0'
1265 $ hg ci -m 'a0'
1266 $ echo 6 >> b
1266 $ echo 6 >> b
1267 $ hg ci -m 'b0'
1267 $ hg ci -m 'b0'
1268 $ hg up -q 4
1268 $ hg up -q 4
1269 $ echo 7 >> b
1269 $ echo 7 >> b
1270 $ hg ci -m 'b1'
1270 $ hg ci -m 'b1'
1271 created new head
1271 created new head
1272 $ echo 8 >> a
1272 $ echo 8 >> a
1273 $ hg ci -m 'a1'
1273 $ hg ci -m 'a1'
1274 $ hg rm a
1274 $ hg rm a
1275 $ hg mv b a
1275 $ hg mv b a
1276 $ hg ci -m 'b1->a1'
1276 $ hg ci -m 'b1->a1'
1277 $ hg merge -qt :local
1277 $ hg merge -qt :local
1278 $ hg ci -m '(a0,b1->a1)->a'
1278 $ hg ci -m '(a0,b1->a1)->a'
1279
1279
1280 $ hg log -GT '{rev}: {desc}\n'
1280 $ hg log -GT '{rev}: {desc}\n'
1281 @ 10: (a0,b1->a1)->a
1281 @ 10: (a0,b1->a1)->a
1282 |\
1282 |\
1283 | o 9: b1->a1
1283 | o 9: b1->a1
1284 | |
1284 | |
1285 | o 8: a1
1285 | o 8: a1
1286 | |
1286 | |
1287 | o 7: b1
1287 | o 7: b1
1288 | |
1288 | |
1289 o | 6: b0
1289 o | 6: b0
1290 | |
1290 | |
1291 o | 5: a0
1291 o | 5: a0
1292 |/
1292 |/
1293 o 4: a,b
1293 o 4: a,b
1294 |
1294 |
1295 o 3: b
1295 o 3: b
1296 |
1296 |
1297 o 2: a
1297 o 2: a
1298 |
1298 |
1299 o 1: a->b
1299 o 1: a->b
1300 |
1300 |
1301 o 0: a
1301 o 0: a
1302
1302
1303
1303
1304 since file 'a' has multiple copy sources at the revision 4, ancestors can't
1304 since file 'a' has multiple copy sources at the revision 4, ancestors can't
1305 be indexed solely by fctx.linkrev().
1305 be indexed solely by fctx.linkrev().
1306
1306
1307 $ hg log -T '{rev}: {desc}\n' -f a
1307 $ hg log -T '{rev}: {desc}\n' -f a
1308 10: (a0,b1->a1)->a
1308 10: (a0,b1->a1)->a
1309 9: b1->a1
1309 9: b1->a1
1310 7: b1
1310 7: b1
1311 5: a0
1311 5: a0
1312 4: a,b
1312 4: a,b
1313 3: b
1313 3: b
1314 2: a
1314 2: a
1315 1: a->b
1315 1: a->b
1316 0: a
1316 0: a
1317
1317
1318 $ cd ..
1318 $ cd ..
1319
1319
1320 Test that log should respect the order of -rREV even if multiple OR conditions
1320 Test that log should respect the order of -rREV even if multiple OR conditions
1321 are specified (issue5100):
1321 are specified (issue5100):
1322
1322
1323 $ hg init revorder
1323 $ hg init revorder
1324 $ cd revorder
1324 $ cd revorder
1325
1325
1326 $ hg branch -q b0
1326 $ hg branch -q b0
1327 $ echo 0 >> f0
1327 $ echo 0 >> f0
1328 $ hg ci -qAm k0 -u u0
1328 $ hg ci -qAm k0 -u u0
1329 $ hg branch -q b1
1329 $ hg branch -q b1
1330 $ echo 1 >> f1
1330 $ echo 1 >> f1
1331 $ hg ci -qAm k1 -u u1
1331 $ hg ci -qAm k1 -u u1
1332 $ hg branch -q b2
1332 $ hg branch -q b2
1333 $ echo 2 >> f2
1333 $ echo 2 >> f2
1334 $ hg ci -qAm k2 -u u2
1334 $ hg ci -qAm k2 -u u2
1335
1335
1336 $ hg update -q b2
1336 $ hg update -q b2
1337 $ echo 3 >> f2
1337 $ echo 3 >> f2
1338 $ hg ci -qAm k2 -u u2
1338 $ hg ci -qAm k2 -u u2
1339 $ hg update -q b1
1339 $ hg update -q b1
1340 $ echo 4 >> f1
1340 $ echo 4 >> f1
1341 $ hg ci -qAm k1 -u u1
1341 $ hg ci -qAm k1 -u u1
1342 $ hg update -q b0
1342 $ hg update -q b0
1343 $ echo 5 >> f0
1343 $ echo 5 >> f0
1344 $ hg ci -qAm k0 -u u0
1344 $ hg ci -qAm k0 -u u0
1345
1345
1346 summary of revisions:
1346 summary of revisions:
1347
1347
1348 $ hg log -G -T '{rev} {branch} {author} {desc} {files}\n'
1348 $ hg log -G -T '{rev} {branch} {author} {desc} {files}\n'
1349 @ 5 b0 u0 k0 f0
1349 @ 5 b0 u0 k0 f0
1350 |
1350 |
1351 | o 4 b1 u1 k1 f1
1351 | o 4 b1 u1 k1 f1
1352 | |
1352 | |
1353 | | o 3 b2 u2 k2 f2
1353 | | o 3 b2 u2 k2 f2
1354 | | |
1354 | | |
1355 | | o 2 b2 u2 k2 f2
1355 | | o 2 b2 u2 k2 f2
1356 | |/
1356 | |/
1357 | o 1 b1 u1 k1 f1
1357 | o 1 b1 u1 k1 f1
1358 |/
1358 |/
1359 o 0 b0 u0 k0 f0
1359 o 0 b0 u0 k0 f0
1360
1360
1361
1361
1362 log -b BRANCH in ascending order:
1362 log -b BRANCH in ascending order:
1363
1363
1364 $ hg log -r0:tip -T '{rev} {branch}\n' -b b0 -b b1
1364 $ hg log -r0:tip -T '{rev} {branch}\n' -b b0 -b b1
1365 0 b0
1365 0 b0
1366 1 b1
1366 1 b1
1367 4 b1
1367 4 b1
1368 5 b0
1368 5 b0
1369 $ hg log -r0:tip -T '{rev} {branch}\n' -b b1 -b b0
1369 $ hg log -r0:tip -T '{rev} {branch}\n' -b b1 -b b0
1370 0 b0
1370 0 b0
1371 1 b1
1371 1 b1
1372 4 b1
1372 4 b1
1373 5 b0
1373 5 b0
1374
1374
1375 log --only-branch BRANCH in descending order:
1375 log --only-branch BRANCH in descending order:
1376
1376
1377 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b1 --only-branch b2
1377 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b1 --only-branch b2
1378 4 b1
1378 4 b1
1379 3 b2
1379 3 b2
1380 2 b2
1380 2 b2
1381 1 b1
1381 1 b1
1382 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b2 --only-branch b1
1382 $ hg log -rtip:0 -T '{rev} {branch}\n' --only-branch b2 --only-branch b1
1383 4 b1
1383 4 b1
1384 3 b2
1384 3 b2
1385 2 b2
1385 2 b2
1386 1 b1
1386 1 b1
1387
1387
1388 log -u USER in ascending order, against compound set:
1388 log -u USER in ascending order, against compound set:
1389
1389
1390 $ hg log -r'::head()' -T '{rev} {author}\n' -u u0 -u u2
1390 $ hg log -r'::head()' -T '{rev} {author}\n' -u u0 -u u2
1391 0 u0
1391 0 u0
1392 2 u2
1392 2 u2
1393 3 u2
1393 3 u2
1394 5 u0
1394 5 u0
1395 $ hg log -r'::head()' -T '{rev} {author}\n' -u u2 -u u0
1395 $ hg log -r'::head()' -T '{rev} {author}\n' -u u2 -u u0
1396 0 u0
1396 0 u0
1397 2 u2
1397 2 u2
1398 3 u2
1398 3 u2
1399 5 u0
1399 5 u0
1400
1400
1401 log -k TEXT in descending order, against compound set:
1401 log -k TEXT in descending order, against compound set:
1402
1402
1403 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k0 -k k1 -k k2
1403 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k0 -k k1 -k k2
1404 5 k0
1404 5 k0
1405 3 k2
1405 3 k2
1406 2 k2
1406 2 k2
1407 1 k1
1407 1 k1
1408 0 k0
1408 0 k0
1409 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k2 -k k1 -k k0
1409 $ hg log -r'5 + reverse(::3)' -T '{rev} {desc}\n' -k k2 -k k1 -k k0
1410 5 k0
1410 5 k0
1411 3 k2
1411 3 k2
1412 2 k2
1412 2 k2
1413 1 k1
1413 1 k1
1414 0 k0
1414 0 k0
1415
1415
1416 log -b/-u/-k shouldn't accept string-matcher syntax:
1416 log -b/-u/-k shouldn't accept string-matcher syntax:
1417
1417
1418 $ hg log -b 're:.*'
1418 $ hg log -b 're:.*'
1419 abort: unknown revision 're:.*'
1419 abort: unknown revision 're:.*'
1420 [10]
1420 [10]
1421 $ hg log -k 're:.*'
1421 $ hg log -k 're:.*'
1422 $ hg log -u 're:.*'
1422 $ hg log -u 're:.*'
1423
1423
1424 log FILE in ascending order, against dagrange:
1424 log FILE in ascending order, against dagrange:
1425
1425
1426 $ hg log -r1:: -T '{rev} {files}\n' f1 f2
1426 $ hg log -r1:: -T '{rev} {files}\n' f1 f2
1427 1 f1
1427 1 f1
1428 2 f2
1428 2 f2
1429 3 f2
1429 3 f2
1430 4 f1
1430 4 f1
1431 $ hg log -r1:: -T '{rev} {files}\n' f2 f1
1431 $ hg log -r1:: -T '{rev} {files}\n' f2 f1
1432 1 f1
1432 1 f1
1433 2 f2
1433 2 f2
1434 3 f2
1434 3 f2
1435 4 f1
1435 4 f1
1436
1436
1437 $ cd ..
1437 $ cd ..
1438
1438
1439 User
1439 User
1440
1440
1441 $ hg init usertest
1441 $ hg init usertest
1442 $ cd usertest
1442 $ cd usertest
1443
1443
1444 $ echo a > a
1444 $ echo a > a
1445 $ hg ci -A -m "a" -u "User One <user1@example.org>"
1445 $ hg ci -A -m "a" -u "User One <user1@example.org>"
1446 adding a
1446 adding a
1447 $ echo b > b
1447 $ echo b > b
1448 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
1448 $ hg ci -A -m "b" -u "User Two <user2@example.org>"
1449 adding b
1449 adding b
1450
1450
1451 $ hg log -u "User One <user1@example.org>"
1451 $ hg log -u "User One <user1@example.org>"
1452 changeset: 0:29a4c94f1924
1452 changeset: 0:29a4c94f1924
1453 user: User One <user1@example.org>
1453 user: User One <user1@example.org>
1454 date: Thu Jan 01 00:00:00 1970 +0000
1454 date: Thu Jan 01 00:00:00 1970 +0000
1455 summary: a
1455 summary: a
1456
1456
1457 $ hg log -u "user1" -u "user2"
1457 $ hg log -u "user1" -u "user2"
1458 changeset: 1:e834b5e69c0e
1458 changeset: 1:e834b5e69c0e
1459 tag: tip
1459 tag: tip
1460 user: User Two <user2@example.org>
1460 user: User Two <user2@example.org>
1461 date: Thu Jan 01 00:00:00 1970 +0000
1461 date: Thu Jan 01 00:00:00 1970 +0000
1462 summary: b
1462 summary: b
1463
1463
1464 changeset: 0:29a4c94f1924
1464 changeset: 0:29a4c94f1924
1465 user: User One <user1@example.org>
1465 user: User One <user1@example.org>
1466 date: Thu Jan 01 00:00:00 1970 +0000
1466 date: Thu Jan 01 00:00:00 1970 +0000
1467 summary: a
1467 summary: a
1468
1468
1469 $ hg log -u "user3"
1469 $ hg log -u "user3"
1470
1470
1471 "-u USER" shouldn't be overridden by "user(USER)" alias
1471 "-u USER" shouldn't be overridden by "user(USER)" alias
1472
1472
1473 $ hg log --config 'revsetalias.user(x)=branch(x)' -u default
1473 $ hg log --config 'revsetalias.user(x)=branch(x)' -u default
1474 $ hg log --config 'revsetalias.user(x)=branch(x)' -u user1
1474 $ hg log --config 'revsetalias.user(x)=branch(x)' -u user1
1475 changeset: 0:29a4c94f1924
1475 changeset: 0:29a4c94f1924
1476 user: User One <user1@example.org>
1476 user: User One <user1@example.org>
1477 date: Thu Jan 01 00:00:00 1970 +0000
1477 date: Thu Jan 01 00:00:00 1970 +0000
1478 summary: a
1478 summary: a
1479
1479
1480
1480
1481 $ cd ..
1481 $ cd ..
1482
1482
1483 $ hg init branches
1483 $ hg init branches
1484 $ cd branches
1484 $ cd branches
1485
1485
1486 $ echo a > a
1486 $ echo a > a
1487 $ hg ci -A -m "commit on default"
1487 $ hg ci -A -m "commit on default"
1488 adding a
1488 adding a
1489 $ hg branch test
1489 $ hg branch test
1490 marked working directory as branch test
1490 marked working directory as branch test
1491 (branches are permanent and global, did you want a bookmark?)
1491 (branches are permanent and global, did you want a bookmark?)
1492 $ echo b > b
1492 $ echo b > b
1493 $ hg ci -A -m "commit on test"
1493 $ hg ci -A -m "commit on test"
1494 adding b
1494 adding b
1495
1495
1496 $ hg up default
1496 $ hg up default
1497 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1497 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1498 $ echo c > c
1498 $ echo c > c
1499 $ hg ci -A -m "commit on default"
1499 $ hg ci -A -m "commit on default"
1500 adding c
1500 adding c
1501 $ hg up test
1501 $ hg up test
1502 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1502 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1503 $ echo c > c
1503 $ echo c > c
1504 $ hg ci -A -m "commit on test"
1504 $ hg ci -A -m "commit on test"
1505 adding c
1505 adding c
1506
1506
1507
1507
1508 log -b default
1508 log -b default
1509
1509
1510 $ hg log -b default
1510 $ hg log -b default
1511 changeset: 2:c3a4f03cc9a7
1511 changeset: 2:c3a4f03cc9a7
1512 parent: 0:24427303d56f
1512 parent: 0:24427303d56f
1513 user: test
1513 user: test
1514 date: Thu Jan 01 00:00:00 1970 +0000
1514 date: Thu Jan 01 00:00:00 1970 +0000
1515 summary: commit on default
1515 summary: commit on default
1516
1516
1517 changeset: 0:24427303d56f
1517 changeset: 0:24427303d56f
1518 user: test
1518 user: test
1519 date: Thu Jan 01 00:00:00 1970 +0000
1519 date: Thu Jan 01 00:00:00 1970 +0000
1520 summary: commit on default
1520 summary: commit on default
1521
1521
1522
1522
1523
1523
1524 log -b test
1524 log -b test
1525
1525
1526 $ hg log -b test
1526 $ hg log -b test
1527 changeset: 3:f5d8de11c2e2
1527 changeset: 3:f5d8de11c2e2
1528 branch: test
1528 branch: test
1529 tag: tip
1529 tag: tip
1530 parent: 1:d32277701ccb
1530 parent: 1:d32277701ccb
1531 user: test
1531 user: test
1532 date: Thu Jan 01 00:00:00 1970 +0000
1532 date: Thu Jan 01 00:00:00 1970 +0000
1533 summary: commit on test
1533 summary: commit on test
1534
1534
1535 changeset: 1:d32277701ccb
1535 changeset: 1:d32277701ccb
1536 branch: test
1536 branch: test
1537 user: test
1537 user: test
1538 date: Thu Jan 01 00:00:00 1970 +0000
1538 date: Thu Jan 01 00:00:00 1970 +0000
1539 summary: commit on test
1539 summary: commit on test
1540
1540
1541
1541
1542
1542
1543 log -b dummy
1543 log -b dummy
1544
1544
1545 $ hg log -b dummy
1545 $ hg log -b dummy
1546 abort: unknown revision 'dummy'
1546 abort: unknown revision 'dummy'
1547 [10]
1547 [10]
1548
1548
1549
1549
1550 log -b .
1550 log -b .
1551
1551
1552 $ hg log -b .
1552 $ hg log -b .
1553 changeset: 3:f5d8de11c2e2
1553 changeset: 3:f5d8de11c2e2
1554 branch: test
1554 branch: test
1555 tag: tip
1555 tag: tip
1556 parent: 1:d32277701ccb
1556 parent: 1:d32277701ccb
1557 user: test
1557 user: test
1558 date: Thu Jan 01 00:00:00 1970 +0000
1558 date: Thu Jan 01 00:00:00 1970 +0000
1559 summary: commit on test
1559 summary: commit on test
1560
1560
1561 changeset: 1:d32277701ccb
1561 changeset: 1:d32277701ccb
1562 branch: test
1562 branch: test
1563 user: test
1563 user: test
1564 date: Thu Jan 01 00:00:00 1970 +0000
1564 date: Thu Jan 01 00:00:00 1970 +0000
1565 summary: commit on test
1565 summary: commit on test
1566
1566
1567
1567
1568
1568
1569 log -b default -b test
1569 log -b default -b test
1570
1570
1571 $ hg log -b default -b test
1571 $ hg log -b default -b test
1572 changeset: 3:f5d8de11c2e2
1572 changeset: 3:f5d8de11c2e2
1573 branch: test
1573 branch: test
1574 tag: tip
1574 tag: tip
1575 parent: 1:d32277701ccb
1575 parent: 1:d32277701ccb
1576 user: test
1576 user: test
1577 date: Thu Jan 01 00:00:00 1970 +0000
1577 date: Thu Jan 01 00:00:00 1970 +0000
1578 summary: commit on test
1578 summary: commit on test
1579
1579
1580 changeset: 2:c3a4f03cc9a7
1580 changeset: 2:c3a4f03cc9a7
1581 parent: 0:24427303d56f
1581 parent: 0:24427303d56f
1582 user: test
1582 user: test
1583 date: Thu Jan 01 00:00:00 1970 +0000
1583 date: Thu Jan 01 00:00:00 1970 +0000
1584 summary: commit on default
1584 summary: commit on default
1585
1585
1586 changeset: 1:d32277701ccb
1586 changeset: 1:d32277701ccb
1587 branch: test
1587 branch: test
1588 user: test
1588 user: test
1589 date: Thu Jan 01 00:00:00 1970 +0000
1589 date: Thu Jan 01 00:00:00 1970 +0000
1590 summary: commit on test
1590 summary: commit on test
1591
1591
1592 changeset: 0:24427303d56f
1592 changeset: 0:24427303d56f
1593 user: test
1593 user: test
1594 date: Thu Jan 01 00:00:00 1970 +0000
1594 date: Thu Jan 01 00:00:00 1970 +0000
1595 summary: commit on default
1595 summary: commit on default
1596
1596
1597
1597
1598
1598
1599 log -b default -b .
1599 log -b default -b .
1600
1600
1601 $ hg log -b default -b .
1601 $ hg log -b default -b .
1602 changeset: 3:f5d8de11c2e2
1602 changeset: 3:f5d8de11c2e2
1603 branch: test
1603 branch: test
1604 tag: tip
1604 tag: tip
1605 parent: 1:d32277701ccb
1605 parent: 1:d32277701ccb
1606 user: test
1606 user: test
1607 date: Thu Jan 01 00:00:00 1970 +0000
1607 date: Thu Jan 01 00:00:00 1970 +0000
1608 summary: commit on test
1608 summary: commit on test
1609
1609
1610 changeset: 2:c3a4f03cc9a7
1610 changeset: 2:c3a4f03cc9a7
1611 parent: 0:24427303d56f
1611 parent: 0:24427303d56f
1612 user: test
1612 user: test
1613 date: Thu Jan 01 00:00:00 1970 +0000
1613 date: Thu Jan 01 00:00:00 1970 +0000
1614 summary: commit on default
1614 summary: commit on default
1615
1615
1616 changeset: 1:d32277701ccb
1616 changeset: 1:d32277701ccb
1617 branch: test
1617 branch: test
1618 user: test
1618 user: test
1619 date: Thu Jan 01 00:00:00 1970 +0000
1619 date: Thu Jan 01 00:00:00 1970 +0000
1620 summary: commit on test
1620 summary: commit on test
1621
1621
1622 changeset: 0:24427303d56f
1622 changeset: 0:24427303d56f
1623 user: test
1623 user: test
1624 date: Thu Jan 01 00:00:00 1970 +0000
1624 date: Thu Jan 01 00:00:00 1970 +0000
1625 summary: commit on default
1625 summary: commit on default
1626
1626
1627
1627
1628
1628
1629 log -b . -b test
1629 log -b . -b test
1630
1630
1631 $ hg log -b . -b test
1631 $ hg log -b . -b test
1632 changeset: 3:f5d8de11c2e2
1632 changeset: 3:f5d8de11c2e2
1633 branch: test
1633 branch: test
1634 tag: tip
1634 tag: tip
1635 parent: 1:d32277701ccb
1635 parent: 1:d32277701ccb
1636 user: test
1636 user: test
1637 date: Thu Jan 01 00:00:00 1970 +0000
1637 date: Thu Jan 01 00:00:00 1970 +0000
1638 summary: commit on test
1638 summary: commit on test
1639
1639
1640 changeset: 1:d32277701ccb
1640 changeset: 1:d32277701ccb
1641 branch: test
1641 branch: test
1642 user: test
1642 user: test
1643 date: Thu Jan 01 00:00:00 1970 +0000
1643 date: Thu Jan 01 00:00:00 1970 +0000
1644 summary: commit on test
1644 summary: commit on test
1645
1645
1646
1646
1647
1647
1648 log -b 2
1648 log -b 2
1649
1649
1650 $ hg log -b 2
1650 $ hg log -b 2
1651 changeset: 2:c3a4f03cc9a7
1651 changeset: 2:c3a4f03cc9a7
1652 parent: 0:24427303d56f
1652 parent: 0:24427303d56f
1653 user: test
1653 user: test
1654 date: Thu Jan 01 00:00:00 1970 +0000
1654 date: Thu Jan 01 00:00:00 1970 +0000
1655 summary: commit on default
1655 summary: commit on default
1656
1656
1657 changeset: 0:24427303d56f
1657 changeset: 0:24427303d56f
1658 user: test
1658 user: test
1659 date: Thu Jan 01 00:00:00 1970 +0000
1659 date: Thu Jan 01 00:00:00 1970 +0000
1660 summary: commit on default
1660 summary: commit on default
1661
1661
1662 #if gettext
1662 #if gettext
1663
1663
1664 Test that all log names are translated (e.g. branches, bookmarks, tags):
1664 Test that all log names are translated (e.g. branches, bookmarks, tags):
1665
1665
1666 $ hg bookmark babar -r tip
1666 $ hg bookmark babar -r tip
1667
1667
1668 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1668 $ HGENCODING=UTF-8 LANGUAGE=de hg log -r tip
1669 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1669 \xc3\x84nderung: 3:f5d8de11c2e2 (esc)
1670 Zweig: test
1670 Zweig: test
1671 Lesezeichen: babar
1671 Lesezeichen: babar
1672 Marke: tip
1672 Marke: tip
1673 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1673 Vorg\xc3\xa4nger: 1:d32277701ccb (esc)
1674 Nutzer: test
1674 Nutzer: test
1675 Datum: Thu Jan 01 00:00:00 1970 +0000
1675 Datum: Thu Jan 01 00:00:00 1970 +0000
1676 Zusammenfassung: commit on test
1676 Zusammenfassung: commit on test
1677
1677
1678 $ hg bookmark -d babar
1678 $ hg bookmark -d babar
1679
1679
1680 #endif
1680 #endif
1681
1681
1682 log -p --cwd dir (in subdir)
1682 log -p --cwd dir (in subdir)
1683
1683
1684 $ mkdir dir
1684 $ mkdir dir
1685 $ hg log -p --cwd dir
1685 $ hg log -p --cwd dir
1686 changeset: 3:f5d8de11c2e2
1686 changeset: 3:f5d8de11c2e2
1687 branch: test
1687 branch: test
1688 tag: tip
1688 tag: tip
1689 parent: 1:d32277701ccb
1689 parent: 1:d32277701ccb
1690 user: test
1690 user: test
1691 date: Thu Jan 01 00:00:00 1970 +0000
1691 date: Thu Jan 01 00:00:00 1970 +0000
1692 summary: commit on test
1692 summary: commit on test
1693
1693
1694 diff -r d32277701ccb -r f5d8de11c2e2 c
1694 diff -r d32277701ccb -r f5d8de11c2e2 c
1695 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1695 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1696 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1696 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1697 @@ -0,0 +1,1 @@
1697 @@ -0,0 +1,1 @@
1698 +c
1698 +c
1699
1699
1700 changeset: 2:c3a4f03cc9a7
1700 changeset: 2:c3a4f03cc9a7
1701 parent: 0:24427303d56f
1701 parent: 0:24427303d56f
1702 user: test
1702 user: test
1703 date: Thu Jan 01 00:00:00 1970 +0000
1703 date: Thu Jan 01 00:00:00 1970 +0000
1704 summary: commit on default
1704 summary: commit on default
1705
1705
1706 diff -r 24427303d56f -r c3a4f03cc9a7 c
1706 diff -r 24427303d56f -r c3a4f03cc9a7 c
1707 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1707 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1708 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1708 +++ b/c Thu Jan 01 00:00:00 1970 +0000
1709 @@ -0,0 +1,1 @@
1709 @@ -0,0 +1,1 @@
1710 +c
1710 +c
1711
1711
1712 changeset: 1:d32277701ccb
1712 changeset: 1:d32277701ccb
1713 branch: test
1713 branch: test
1714 user: test
1714 user: test
1715 date: Thu Jan 01 00:00:00 1970 +0000
1715 date: Thu Jan 01 00:00:00 1970 +0000
1716 summary: commit on test
1716 summary: commit on test
1717
1717
1718 diff -r 24427303d56f -r d32277701ccb b
1718 diff -r 24427303d56f -r d32277701ccb b
1719 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1719 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1720 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1720 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1721 @@ -0,0 +1,1 @@
1721 @@ -0,0 +1,1 @@
1722 +b
1722 +b
1723
1723
1724 changeset: 0:24427303d56f
1724 changeset: 0:24427303d56f
1725 user: test
1725 user: test
1726 date: Thu Jan 01 00:00:00 1970 +0000
1726 date: Thu Jan 01 00:00:00 1970 +0000
1727 summary: commit on default
1727 summary: commit on default
1728
1728
1729 diff -r 000000000000 -r 24427303d56f a
1729 diff -r 000000000000 -r 24427303d56f a
1730 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1730 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1731 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1731 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1732 @@ -0,0 +1,1 @@
1732 @@ -0,0 +1,1 @@
1733 +a
1733 +a
1734
1734
1735
1735
1736
1736
1737 log -p -R repo
1737 log -p -R repo
1738
1738
1739 $ cd dir
1739 $ cd dir
1740 $ hg log -p -R .. ../a
1740 $ hg log -p -R .. ../a
1741 changeset: 0:24427303d56f
1741 changeset: 0:24427303d56f
1742 user: test
1742 user: test
1743 date: Thu Jan 01 00:00:00 1970 +0000
1743 date: Thu Jan 01 00:00:00 1970 +0000
1744 summary: commit on default
1744 summary: commit on default
1745
1745
1746 diff -r 000000000000 -r 24427303d56f a
1746 diff -r 000000000000 -r 24427303d56f a
1747 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1747 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1748 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1748 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1749 @@ -0,0 +1,1 @@
1749 @@ -0,0 +1,1 @@
1750 +a
1750 +a
1751
1751
1752
1752
1753 $ cd ../..
1753 $ cd ../..
1754
1754
1755 $ hg init follow2
1755 $ hg init follow2
1756 $ cd follow2
1756 $ cd follow2
1757
1757
1758 # Build the following history:
1758 # Build the following history:
1759 # tip - o - x - o - x - x
1759 # tip - o - x - o - x - x
1760 # \ /
1760 # \ /
1761 # o - o - o - x
1761 # o - o - o - x
1762 # \ /
1762 # \ /
1763 # o
1763 # o
1764 #
1764 #
1765 # Where "o" is a revision containing "foo" and
1765 # Where "o" is a revision containing "foo" and
1766 # "x" is a revision without "foo"
1766 # "x" is a revision without "foo"
1767
1767
1768 $ touch init
1768 $ touch init
1769 $ hg ci -A -m "init, unrelated"
1769 $ hg ci -A -m "init, unrelated"
1770 adding init
1770 adding init
1771 $ echo 'foo' > init
1771 $ echo 'foo' > init
1772 $ hg ci -m "change, unrelated"
1772 $ hg ci -m "change, unrelated"
1773 $ echo 'foo' > foo
1773 $ echo 'foo' > foo
1774 $ hg ci -A -m "add unrelated old foo"
1774 $ hg ci -A -m "add unrelated old foo"
1775 adding foo
1775 adding foo
1776 $ hg rm foo
1776 $ hg rm foo
1777 $ hg ci -m "delete foo, unrelated"
1777 $ hg ci -m "delete foo, unrelated"
1778 $ echo 'related' > foo
1778 $ echo 'related' > foo
1779 $ hg ci -A -m "add foo, related"
1779 $ hg ci -A -m "add foo, related"
1780 adding foo
1780 adding foo
1781
1781
1782 $ hg up 0
1782 $ hg up 0
1783 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1783 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1784 $ touch branch
1784 $ touch branch
1785 $ hg ci -A -m "first branch, unrelated"
1785 $ hg ci -A -m "first branch, unrelated"
1786 adding branch
1786 adding branch
1787 created new head
1787 created new head
1788 $ touch foo
1788 $ touch foo
1789 $ hg ci -A -m "create foo, related"
1789 $ hg ci -A -m "create foo, related"
1790 adding foo
1790 adding foo
1791 $ echo 'change' > foo
1791 $ echo 'change' > foo
1792 $ hg ci -m "change foo, related"
1792 $ hg ci -m "change foo, related"
1793
1793
1794 $ hg up 6
1794 $ hg up 6
1795 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1795 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1796 $ echo 'change foo in branch' > foo
1796 $ echo 'change foo in branch' > foo
1797 $ hg ci -m "change foo in branch, related"
1797 $ hg ci -m "change foo in branch, related"
1798 created new head
1798 created new head
1799 $ hg merge 7
1799 $ hg merge 7
1800 merging foo
1800 merging foo
1801 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1801 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1802 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1802 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
1803 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1803 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1804 [1]
1804 [1]
1805 $ echo 'merge 1' > foo
1805 $ echo 'merge 1' > foo
1806 $ hg resolve -m foo
1806 $ hg resolve -m foo
1807 (no more unresolved files)
1807 (no more unresolved files)
1808 $ hg ci -m "First merge, related"
1808 $ hg ci -m "First merge, related"
1809
1809
1810 $ hg merge 4
1810 $ hg merge 4
1811 merging foo
1811 merging foo
1812 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1812 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
1813 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1813 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
1814 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1814 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
1815 [1]
1815 [1]
1816 $ echo 'merge 2' > foo
1816 $ echo 'merge 2' > foo
1817 $ hg resolve -m foo
1817 $ hg resolve -m foo
1818 (no more unresolved files)
1818 (no more unresolved files)
1819 $ hg ci -m "Last merge, related"
1819 $ hg ci -m "Last merge, related"
1820
1820
1821 $ hg log --graph
1821 $ hg log --graph
1822 @ changeset: 10:4dae8563d2c5
1822 @ changeset: 10:4dae8563d2c5
1823 |\ tag: tip
1823 |\ tag: tip
1824 | | parent: 9:7b35701b003e
1824 | | parent: 9:7b35701b003e
1825 | | parent: 4:88176d361b69
1825 | | parent: 4:88176d361b69
1826 | | user: test
1826 | | user: test
1827 | | date: Thu Jan 01 00:00:00 1970 +0000
1827 | | date: Thu Jan 01 00:00:00 1970 +0000
1828 | | summary: Last merge, related
1828 | | summary: Last merge, related
1829 | |
1829 | |
1830 | o changeset: 9:7b35701b003e
1830 | o changeset: 9:7b35701b003e
1831 | |\ parent: 8:e5416ad8a855
1831 | |\ parent: 8:e5416ad8a855
1832 | | | parent: 7:87fe3144dcfa
1832 | | | parent: 7:87fe3144dcfa
1833 | | | user: test
1833 | | | user: test
1834 | | | date: Thu Jan 01 00:00:00 1970 +0000
1834 | | | date: Thu Jan 01 00:00:00 1970 +0000
1835 | | | summary: First merge, related
1835 | | | summary: First merge, related
1836 | | |
1836 | | |
1837 | | o changeset: 8:e5416ad8a855
1837 | | o changeset: 8:e5416ad8a855
1838 | | | parent: 6:dc6c325fe5ee
1838 | | | parent: 6:dc6c325fe5ee
1839 | | | user: test
1839 | | | user: test
1840 | | | date: Thu Jan 01 00:00:00 1970 +0000
1840 | | | date: Thu Jan 01 00:00:00 1970 +0000
1841 | | | summary: change foo in branch, related
1841 | | | summary: change foo in branch, related
1842 | | |
1842 | | |
1843 | o | changeset: 7:87fe3144dcfa
1843 | o | changeset: 7:87fe3144dcfa
1844 | |/ user: test
1844 | |/ user: test
1845 | | date: Thu Jan 01 00:00:00 1970 +0000
1845 | | date: Thu Jan 01 00:00:00 1970 +0000
1846 | | summary: change foo, related
1846 | | summary: change foo, related
1847 | |
1847 | |
1848 | o changeset: 6:dc6c325fe5ee
1848 | o changeset: 6:dc6c325fe5ee
1849 | | user: test
1849 | | user: test
1850 | | date: Thu Jan 01 00:00:00 1970 +0000
1850 | | date: Thu Jan 01 00:00:00 1970 +0000
1851 | | summary: create foo, related
1851 | | summary: create foo, related
1852 | |
1852 | |
1853 | o changeset: 5:73db34516eb9
1853 | o changeset: 5:73db34516eb9
1854 | | parent: 0:e87515fd044a
1854 | | parent: 0:e87515fd044a
1855 | | user: test
1855 | | user: test
1856 | | date: Thu Jan 01 00:00:00 1970 +0000
1856 | | date: Thu Jan 01 00:00:00 1970 +0000
1857 | | summary: first branch, unrelated
1857 | | summary: first branch, unrelated
1858 | |
1858 | |
1859 o | changeset: 4:88176d361b69
1859 o | changeset: 4:88176d361b69
1860 | | user: test
1860 | | user: test
1861 | | date: Thu Jan 01 00:00:00 1970 +0000
1861 | | date: Thu Jan 01 00:00:00 1970 +0000
1862 | | summary: add foo, related
1862 | | summary: add foo, related
1863 | |
1863 | |
1864 o | changeset: 3:dd78ae4afb56
1864 o | changeset: 3:dd78ae4afb56
1865 | | user: test
1865 | | user: test
1866 | | date: Thu Jan 01 00:00:00 1970 +0000
1866 | | date: Thu Jan 01 00:00:00 1970 +0000
1867 | | summary: delete foo, unrelated
1867 | | summary: delete foo, unrelated
1868 | |
1868 | |
1869 o | changeset: 2:c4c64aedf0f7
1869 o | changeset: 2:c4c64aedf0f7
1870 | | user: test
1870 | | user: test
1871 | | date: Thu Jan 01 00:00:00 1970 +0000
1871 | | date: Thu Jan 01 00:00:00 1970 +0000
1872 | | summary: add unrelated old foo
1872 | | summary: add unrelated old foo
1873 | |
1873 | |
1874 o | changeset: 1:e5faa7440653
1874 o | changeset: 1:e5faa7440653
1875 |/ user: test
1875 |/ user: test
1876 | date: Thu Jan 01 00:00:00 1970 +0000
1876 | date: Thu Jan 01 00:00:00 1970 +0000
1877 | summary: change, unrelated
1877 | summary: change, unrelated
1878 |
1878 |
1879 o changeset: 0:e87515fd044a
1879 o changeset: 0:e87515fd044a
1880 user: test
1880 user: test
1881 date: Thu Jan 01 00:00:00 1970 +0000
1881 date: Thu Jan 01 00:00:00 1970 +0000
1882 summary: init, unrelated
1882 summary: init, unrelated
1883
1883
1884
1884
1885 $ hg --traceback log -f foo
1885 $ hg --traceback log -f foo
1886 changeset: 10:4dae8563d2c5
1886 changeset: 10:4dae8563d2c5
1887 tag: tip
1887 tag: tip
1888 parent: 9:7b35701b003e
1888 parent: 9:7b35701b003e
1889 parent: 4:88176d361b69
1889 parent: 4:88176d361b69
1890 user: test
1890 user: test
1891 date: Thu Jan 01 00:00:00 1970 +0000
1891 date: Thu Jan 01 00:00:00 1970 +0000
1892 summary: Last merge, related
1892 summary: Last merge, related
1893
1893
1894 changeset: 9:7b35701b003e
1894 changeset: 9:7b35701b003e
1895 parent: 8:e5416ad8a855
1895 parent: 8:e5416ad8a855
1896 parent: 7:87fe3144dcfa
1896 parent: 7:87fe3144dcfa
1897 user: test
1897 user: test
1898 date: Thu Jan 01 00:00:00 1970 +0000
1898 date: Thu Jan 01 00:00:00 1970 +0000
1899 summary: First merge, related
1899 summary: First merge, related
1900
1900
1901 changeset: 8:e5416ad8a855
1901 changeset: 8:e5416ad8a855
1902 parent: 6:dc6c325fe5ee
1902 parent: 6:dc6c325fe5ee
1903 user: test
1903 user: test
1904 date: Thu Jan 01 00:00:00 1970 +0000
1904 date: Thu Jan 01 00:00:00 1970 +0000
1905 summary: change foo in branch, related
1905 summary: change foo in branch, related
1906
1906
1907 changeset: 7:87fe3144dcfa
1907 changeset: 7:87fe3144dcfa
1908 user: test
1908 user: test
1909 date: Thu Jan 01 00:00:00 1970 +0000
1909 date: Thu Jan 01 00:00:00 1970 +0000
1910 summary: change foo, related
1910 summary: change foo, related
1911
1911
1912 changeset: 6:dc6c325fe5ee
1912 changeset: 6:dc6c325fe5ee
1913 user: test
1913 user: test
1914 date: Thu Jan 01 00:00:00 1970 +0000
1914 date: Thu Jan 01 00:00:00 1970 +0000
1915 summary: create foo, related
1915 summary: create foo, related
1916
1916
1917 changeset: 4:88176d361b69
1917 changeset: 4:88176d361b69
1918 user: test
1918 user: test
1919 date: Thu Jan 01 00:00:00 1970 +0000
1919 date: Thu Jan 01 00:00:00 1970 +0000
1920 summary: add foo, related
1920 summary: add foo, related
1921
1921
1922
1922
1923 Also check when maxrev < lastrevfilelog
1923 Also check when maxrev < lastrevfilelog
1924
1924
1925 $ hg --traceback log -f -r4 foo
1925 $ hg --traceback log -f -r4 foo
1926 changeset: 4:88176d361b69
1926 changeset: 4:88176d361b69
1927 user: test
1927 user: test
1928 date: Thu Jan 01 00:00:00 1970 +0000
1928 date: Thu Jan 01 00:00:00 1970 +0000
1929 summary: add foo, related
1929 summary: add foo, related
1930
1930
1931 $ cd ..
1931 $ cd ..
1932
1932
1933 Issue2383: hg log showing _less_ differences than hg diff
1933 Issue2383: hg log showing _less_ differences than hg diff
1934
1934
1935 $ hg init issue2383
1935 $ hg init issue2383
1936 $ cd issue2383
1936 $ cd issue2383
1937
1937
1938 Create a test repo:
1938 Create a test repo:
1939
1939
1940 $ echo a > a
1940 $ echo a > a
1941 $ hg ci -Am0
1941 $ hg ci -Am0
1942 adding a
1942 adding a
1943 $ echo b > b
1943 $ echo b > b
1944 $ hg ci -Am1
1944 $ hg ci -Am1
1945 adding b
1945 adding b
1946 $ hg co 0
1946 $ hg co 0
1947 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1947 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1948 $ echo b > a
1948 $ echo b > a
1949 $ hg ci -m2
1949 $ hg ci -m2
1950 created new head
1950 created new head
1951
1951
1952 Merge:
1952 Merge:
1953
1953
1954 $ hg merge
1954 $ hg merge
1955 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1955 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1956 (branch merge, don't forget to commit)
1956 (branch merge, don't forget to commit)
1957
1957
1958 Make sure there's a file listed in the merge to trigger the bug:
1958 Make sure there's a file listed in the merge to trigger the bug:
1959
1959
1960 $ echo c > a
1960 $ echo c > a
1961 $ hg ci -m3
1961 $ hg ci -m3
1962
1962
1963 Two files shown here in diff:
1963 Two files shown here in diff:
1964
1964
1965 $ hg diff --rev 2:3
1965 $ hg diff --rev 2:3
1966 diff -r b09be438c43a -r 8e07aafe1edc a
1966 diff -r b09be438c43a -r 8e07aafe1edc a
1967 --- a/a Thu Jan 01 00:00:00 1970 +0000
1967 --- a/a Thu Jan 01 00:00:00 1970 +0000
1968 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1968 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1969 @@ -1,1 +1,1 @@
1969 @@ -1,1 +1,1 @@
1970 -b
1970 -b
1971 +c
1971 +c
1972 diff -r b09be438c43a -r 8e07aafe1edc b
1972 diff -r b09be438c43a -r 8e07aafe1edc b
1973 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1973 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1974 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1974 +++ b/b Thu Jan 01 00:00:00 1970 +0000
1975 @@ -0,0 +1,1 @@
1975 @@ -0,0 +1,1 @@
1976 +b
1976 +b
1977
1977
1978 Diff here should be the same:
1978 Diff here should be the same:
1979
1979
1980 $ hg log -vpr 3
1980 $ hg log -vpr 3
1981 changeset: 3:8e07aafe1edc
1981 changeset: 3:8e07aafe1edc
1982 tag: tip
1982 tag: tip
1983 parent: 2:b09be438c43a
1983 parent: 2:b09be438c43a
1984 parent: 1:925d80f479bb
1984 parent: 1:925d80f479bb
1985 user: test
1985 user: test
1986 date: Thu Jan 01 00:00:00 1970 +0000
1986 date: Thu Jan 01 00:00:00 1970 +0000
1987 files: a
1987 files: a
1988 description:
1988 description:
1989 3
1989 3
1990
1990
1991
1991
1992 diff -r b09be438c43a -r 8e07aafe1edc a
1992 diff -r b09be438c43a -r 8e07aafe1edc a
1993 --- a/a Thu Jan 01 00:00:00 1970 +0000
1993 --- a/a Thu Jan 01 00:00:00 1970 +0000
1994 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1994 +++ b/a Thu Jan 01 00:00:00 1970 +0000
1995 @@ -1,1 +1,1 @@
1995 @@ -1,1 +1,1 @@
1996 -b
1996 -b
1997 +c
1997 +c
1998 diff -r b09be438c43a -r 8e07aafe1edc b
1998 diff -r b09be438c43a -r 8e07aafe1edc b
1999 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1999 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2000 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2000 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2001 @@ -0,0 +1,1 @@
2001 @@ -0,0 +1,1 @@
2002 +b
2002 +b
2003
2003
2004
2004
2005 Test that diff.merge is respected (file b was added on one side and
2005 Test that diff.merge is respected (file b was added on one side and
2006 and therefore merged cleanly)
2006 and therefore merged cleanly)
2007
2007
2008 $ hg log -pr 3 --config diff.merge=yes
2008 $ hg log -pr 3 --config diff.merge=yes
2009 changeset: 3:8e07aafe1edc
2009 changeset: 3:8e07aafe1edc
2010 tag: tip
2010 tag: tip
2011 parent: 2:b09be438c43a
2011 parent: 2:b09be438c43a
2012 parent: 1:925d80f479bb
2012 parent: 1:925d80f479bb
2013 user: test
2013 user: test
2014 date: Thu Jan 01 00:00:00 1970 +0000
2014 date: Thu Jan 01 00:00:00 1970 +0000
2015 summary: 3
2015 summary: 3
2016
2016
2017 diff -r 8e07aafe1edc a
2017 diff -r 8e07aafe1edc a
2018 --- a/a Thu Jan 01 00:00:00 1970 +0000
2018 --- a/a Thu Jan 01 00:00:00 1970 +0000
2019 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2019 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2020 @@ -1,1 +1,1 @@
2020 @@ -1,1 +1,1 @@
2021 -b
2021 -b
2022 +c
2022 +c
2023
2023
2024 $ cd ..
2024 $ cd ..
2025
2025
2026 'hg log -r rev fn' when last(filelog(fn)) != rev
2026 'hg log -r rev fn' when last(filelog(fn)) != rev
2027
2027
2028 $ hg init simplelog
2028 $ hg init simplelog
2029 $ cd simplelog
2029 $ cd simplelog
2030 $ echo f > a
2030 $ echo f > a
2031 $ hg ci -Am'a' -d '0 0'
2031 $ hg ci -Am'a' -d '0 0'
2032 adding a
2032 adding a
2033 $ echo f >> a
2033 $ echo f >> a
2034 $ hg ci -Am'a bis' -d '1 0'
2034 $ hg ci -Am'a bis' -d '1 0'
2035
2035
2036 $ hg log -r0 a
2036 $ hg log -r0 a
2037 changeset: 0:9f758d63dcde
2037 changeset: 0:9f758d63dcde
2038 user: test
2038 user: test
2039 date: Thu Jan 01 00:00:00 1970 +0000
2039 date: Thu Jan 01 00:00:00 1970 +0000
2040 summary: a
2040 summary: a
2041
2041
2042 enable obsolete to test hidden feature
2042 enable obsolete to test hidden feature
2043
2043
2044 $ cat >> $HGRCPATH << EOF
2044 $ cat >> $HGRCPATH << EOF
2045 > [experimental]
2045 > [experimental]
2046 > evolution.createmarkers=True
2046 > evolution.createmarkers=True
2047 > EOF
2047 > EOF
2048
2048
2049 $ hg log --template='{rev}:{node}\n'
2049 $ hg log --template='{rev}:{node}\n'
2050 1:a765632148dc55d38c35c4f247c618701886cb2f
2050 1:a765632148dc55d38c35c4f247c618701886cb2f
2051 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2051 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2052 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
2052 $ hg debugobsolete a765632148dc55d38c35c4f247c618701886cb2f
2053 1 new obsolescence markers
2053 1 new obsolescence markers
2054 obsoleted 1 changesets
2054 obsoleted 1 changesets
2055 $ hg up null -q
2055 $ hg up null -q
2056 $ hg log --template='{rev}:{node}\n'
2056 $ hg log --template='{rev}:{node}\n'
2057 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2057 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2058 $ hg log --template='{rev}:{node}\n' --hidden
2058 $ hg log --template='{rev}:{node}\n' --hidden
2059 1:a765632148dc55d38c35c4f247c618701886cb2f
2059 1:a765632148dc55d38c35c4f247c618701886cb2f
2060 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2060 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2061 $ hg log -r a
2061 $ hg log -r a
2062 abort: hidden revision 'a' is pruned
2062 abort: hidden revision 'a' is pruned
2063 (use --hidden to access hidden revisions)
2063 (use --hidden to access hidden revisions)
2064 [10]
2064 [10]
2065
2065
2066 test that parent prevent a changeset to be hidden
2066 test that parent prevent a changeset to be hidden
2067
2067
2068 $ hg up 1 -q --hidden
2068 $ hg up 1 -q --hidden
2069 updated to hidden changeset a765632148dc
2069 updated to hidden changeset a765632148dc
2070 (hidden revision 'a765632148dc' is pruned)
2070 (hidden revision 'a765632148dc' is pruned)
2071 $ hg log --template='{rev}:{node}\n'
2071 $ hg log --template='{rev}:{node}\n'
2072 1:a765632148dc55d38c35c4f247c618701886cb2f
2072 1:a765632148dc55d38c35c4f247c618701886cb2f
2073 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2073 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2074
2074
2075 test that second parent prevent a changeset to be hidden too
2075 test that second parent prevent a changeset to be hidden too
2076
2076
2077 $ hg debugsetparents 0 1 # nothing suitable to merge here
2077 $ hg debugsetparents 0 1 # nothing suitable to merge here
2078 $ hg log --template='{rev}:{node}\n'
2078 $ hg log --template='{rev}:{node}\n'
2079 1:a765632148dc55d38c35c4f247c618701886cb2f
2079 1:a765632148dc55d38c35c4f247c618701886cb2f
2080 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2080 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2081 $ hg debugsetparents 1
2081 $ hg debugsetparents 1
2082 $ hg up -q null
2082 $ hg up -q null
2083
2083
2084 bookmarks prevent a changeset being hidden
2084 bookmarks prevent a changeset being hidden
2085
2085
2086 $ hg bookmark --hidden -r 1 X
2086 $ hg bookmark --hidden -r 1 X
2087 bookmarking hidden changeset a765632148dc
2087 bookmarking hidden changeset a765632148dc
2088 (hidden revision 'a765632148dc' is pruned)
2088 (hidden revision 'a765632148dc' is pruned)
2089 $ hg log --template '{rev}:{node}\n'
2089 $ hg log --template '{rev}:{node}\n'
2090 1:a765632148dc55d38c35c4f247c618701886cb2f
2090 1:a765632148dc55d38c35c4f247c618701886cb2f
2091 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2091 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2092 $ hg bookmark -d X
2092 $ hg bookmark -d X
2093
2093
2094 divergent bookmarks are not hidden
2094 divergent bookmarks are not hidden
2095
2095
2096 $ hg bookmark --hidden -r 1 X@foo
2096 $ hg bookmark --hidden -r 1 X@foo
2097 bookmarking hidden changeset a765632148dc
2097 bookmarking hidden changeset a765632148dc
2098 (hidden revision 'a765632148dc' is pruned)
2098 (hidden revision 'a765632148dc' is pruned)
2099 $ hg log --template '{rev}:{node}\n'
2099 $ hg log --template '{rev}:{node}\n'
2100 1:a765632148dc55d38c35c4f247c618701886cb2f
2100 1:a765632148dc55d38c35c4f247c618701886cb2f
2101 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2101 0:9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2102
2102
2103 test hidden revision 0 (issue5385)
2103 test hidden revision 0 (issue5385)
2104
2104
2105 $ hg bookmark -d X@foo
2105 $ hg bookmark -d X@foo
2106 $ hg up null -q
2106 $ hg up null -q
2107 $ hg debugobsolete 9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2107 $ hg debugobsolete 9f758d63dcde62d547ebfb08e1e7ee96535f2b05
2108 1 new obsolescence markers
2108 1 new obsolescence markers
2109 obsoleted 1 changesets
2109 obsoleted 1 changesets
2110 $ echo f > b
2110 $ echo f > b
2111 $ hg ci -Am'b' -d '2 0'
2111 $ hg ci -Am'b' -d '2 0'
2112 adding b
2112 adding b
2113 $ echo f >> b
2113 $ echo f >> b
2114 $ hg ci -m'b bis' -d '3 0'
2114 $ hg ci -m'b bis' -d '3 0'
2115 $ hg log -T'{rev}:{node}\n'
2115 $ hg log -T'{rev}:{node}\n'
2116 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2116 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2117 2:94375ec45bddd2a824535fc04855bd058c926ec0
2117 2:94375ec45bddd2a824535fc04855bd058c926ec0
2118
2118
2119 $ hg log -T'{rev}:{node}\n' -r:
2119 $ hg log -T'{rev}:{node}\n' -r:
2120 2:94375ec45bddd2a824535fc04855bd058c926ec0
2120 2:94375ec45bddd2a824535fc04855bd058c926ec0
2121 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2121 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2122 $ hg log -T'{rev}:{node}\n' -r:tip
2122 $ hg log -T'{rev}:{node}\n' -r:tip
2123 2:94375ec45bddd2a824535fc04855bd058c926ec0
2123 2:94375ec45bddd2a824535fc04855bd058c926ec0
2124 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2124 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2125 $ hg log -T'{rev}:{node}\n' -r:0
2125 $ hg log -T'{rev}:{node}\n' -r:0
2126 abort: hidden revision '0' is pruned
2126 abort: hidden revision '0' is pruned
2127 (use --hidden to access hidden revisions)
2127 (use --hidden to access hidden revisions)
2128 [10]
2128 [10]
2129 $ hg log -T'{rev}:{node}\n' -f
2129 $ hg log -T'{rev}:{node}\n' -f
2130 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2130 3:d7d28b288a6b83d5d2cf49f10c5974deed3a1d2e
2131 2:94375ec45bddd2a824535fc04855bd058c926ec0
2131 2:94375ec45bddd2a824535fc04855bd058c926ec0
2132
2132
2133 clear extensions configuration
2133 clear extensions configuration
2134 $ echo '[extensions]' >> $HGRCPATH
2134 $ echo '[extensions]' >> $HGRCPATH
2135 $ echo "obs=!" >> $HGRCPATH
2135 $ echo "obs=!" >> $HGRCPATH
2136 $ cd ..
2136 $ cd ..
2137
2137
2138 test -u/-k for problematic encoding
2138 test -u/-k for problematic encoding
2139 # unicode: cp932:
2139 # unicode: cp932:
2140 # u30A2 0x83 0x41(= 'A')
2140 # u30A2 0x83 0x41(= 'A')
2141 # u30C2 0x83 0x61(= 'a')
2141 # u30C2 0x83 0x61(= 'a')
2142
2142
2143 $ hg init problematicencoding
2143 $ hg init problematicencoding
2144 $ cd problematicencoding
2144 $ cd problematicencoding
2145
2145
2146 >>> with open('setup.sh', 'wb') as f:
2146 >>> with open('setup.sh', 'wb') as f:
2147 ... f.write(u'''
2147 ... f.write(u'''
2148 ... echo a > text
2148 ... echo a > text
2149 ... hg add text
2149 ... hg add text
2150 ... hg --encoding utf-8 commit -u '\u30A2' -m none
2150 ... hg --encoding utf-8 commit -u '\u30A2' -m none
2151 ... echo b > text
2151 ... echo b > text
2152 ... hg --encoding utf-8 commit -u '\u30C2' -m none
2152 ... hg --encoding utf-8 commit -u '\u30C2' -m none
2153 ... echo c > text
2153 ... echo c > text
2154 ... hg --encoding utf-8 commit -u none -m '\u30A2'
2154 ... hg --encoding utf-8 commit -u none -m '\u30A2'
2155 ... echo d > text
2155 ... echo d > text
2156 ... hg --encoding utf-8 commit -u none -m '\u30C2'
2156 ... hg --encoding utf-8 commit -u none -m '\u30C2'
2157 ... '''.encode('utf-8')) and None
2157 ... '''.encode('utf-8')) and None
2158 $ sh < setup.sh
2158 $ sh < setup.sh
2159
2159
2160 #if no-rhg
2161
2160 test in problematic encoding
2162 test in problematic encoding
2161 >>> with open('test.sh', 'wb') as f:
2163 >>> with open('test.sh', 'wb') as f:
2162 ... f.write(u'''
2164 ... f.write(u'''
2163 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
2165 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30A2'
2164 ... echo ====
2166 ... echo ====
2165 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
2167 ... hg --encoding cp932 log --template '{rev}\\n' -u '\u30C2'
2166 ... echo ====
2168 ... echo ====
2167 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
2169 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30A2'
2168 ... echo ====
2170 ... echo ====
2169 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
2171 ... hg --encoding cp932 log --template '{rev}\\n' -k '\u30C2'
2170 ... '''.encode('cp932')) and None
2172 ... '''.encode('cp932')) and None
2171 $ sh < test.sh
2173 $ sh < test.sh
2172 0
2174 0
2173 ====
2175 ====
2174 1
2176 1
2175 ====
2177 ====
2176 2
2178 2
2177 0
2179 0
2178 ====
2180 ====
2179 3
2181 3
2180 1
2182 1
2181
2183
2184 #endif
2185
2182 $ cd ..
2186 $ cd ..
2183
2187
2184 test hg log on non-existent files and on directories
2188 test hg log on non-existent files and on directories
2185 $ hg init issue1340
2189 $ hg init issue1340
2186 $ cd issue1340
2190 $ cd issue1340
2187 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
2191 $ mkdir d1; mkdir D2; mkdir D3.i; mkdir d4.hg; mkdir d5.d; mkdir .d6
2188 $ echo 1 > d1/f1
2192 $ echo 1 > d1/f1
2189 $ echo 1 > D2/f1
2193 $ echo 1 > D2/f1
2190 $ echo 1 > D3.i/f1
2194 $ echo 1 > D3.i/f1
2191 $ echo 1 > d4.hg/f1
2195 $ echo 1 > d4.hg/f1
2192 $ echo 1 > d5.d/f1
2196 $ echo 1 > d5.d/f1
2193 $ echo 1 > .d6/f1
2197 $ echo 1 > .d6/f1
2194 $ hg -q add .
2198 $ hg -q add .
2195 $ hg commit -m "a bunch of weird directories"
2199 $ hg commit -m "a bunch of weird directories"
2196 $ hg log -l1 d1/f1 | grep changeset
2200 $ hg log -l1 d1/f1 | grep changeset
2197 changeset: 0:65624cd9070a
2201 changeset: 0:65624cd9070a
2198 $ hg log -l1 f1
2202 $ hg log -l1 f1
2199 $ hg log -l1 . | grep changeset
2203 $ hg log -l1 . | grep changeset
2200 changeset: 0:65624cd9070a
2204 changeset: 0:65624cd9070a
2201 $ hg log -l1 ./ | grep changeset
2205 $ hg log -l1 ./ | grep changeset
2202 changeset: 0:65624cd9070a
2206 changeset: 0:65624cd9070a
2203 $ hg log -l1 d1 | grep changeset
2207 $ hg log -l1 d1 | grep changeset
2204 changeset: 0:65624cd9070a
2208 changeset: 0:65624cd9070a
2205 $ hg log -l1 D2 | grep changeset
2209 $ hg log -l1 D2 | grep changeset
2206 changeset: 0:65624cd9070a
2210 changeset: 0:65624cd9070a
2207 $ hg log -l1 D2/f1 | grep changeset
2211 $ hg log -l1 D2/f1 | grep changeset
2208 changeset: 0:65624cd9070a
2212 changeset: 0:65624cd9070a
2209 $ hg log -l1 D3.i | grep changeset
2213 $ hg log -l1 D3.i | grep changeset
2210 changeset: 0:65624cd9070a
2214 changeset: 0:65624cd9070a
2211 $ hg log -l1 D3.i/f1 | grep changeset
2215 $ hg log -l1 D3.i/f1 | grep changeset
2212 changeset: 0:65624cd9070a
2216 changeset: 0:65624cd9070a
2213 $ hg log -l1 d4.hg | grep changeset
2217 $ hg log -l1 d4.hg | grep changeset
2214 changeset: 0:65624cd9070a
2218 changeset: 0:65624cd9070a
2215 $ hg log -l1 d4.hg/f1 | grep changeset
2219 $ hg log -l1 d4.hg/f1 | grep changeset
2216 changeset: 0:65624cd9070a
2220 changeset: 0:65624cd9070a
2217 $ hg log -l1 d5.d | grep changeset
2221 $ hg log -l1 d5.d | grep changeset
2218 changeset: 0:65624cd9070a
2222 changeset: 0:65624cd9070a
2219 $ hg log -l1 d5.d/f1 | grep changeset
2223 $ hg log -l1 d5.d/f1 | grep changeset
2220 changeset: 0:65624cd9070a
2224 changeset: 0:65624cd9070a
2221 $ hg log -l1 .d6 | grep changeset
2225 $ hg log -l1 .d6 | grep changeset
2222 changeset: 0:65624cd9070a
2226 changeset: 0:65624cd9070a
2223 $ hg log -l1 .d6/f1 | grep changeset
2227 $ hg log -l1 .d6/f1 | grep changeset
2224 changeset: 0:65624cd9070a
2228 changeset: 0:65624cd9070a
2225
2229
2226 issue3772: hg log -r :null showing revision 0 as well
2230 issue3772: hg log -r :null showing revision 0 as well
2227
2231
2228 $ hg log -r :null
2232 $ hg log -r :null
2229 changeset: 0:65624cd9070a
2233 changeset: 0:65624cd9070a
2230 tag: tip
2234 tag: tip
2231 user: test
2235 user: test
2232 date: Thu Jan 01 00:00:00 1970 +0000
2236 date: Thu Jan 01 00:00:00 1970 +0000
2233 summary: a bunch of weird directories
2237 summary: a bunch of weird directories
2234
2238
2235 changeset: -1:000000000000
2239 changeset: -1:000000000000
2236 user:
2240 user:
2237 date: Thu Jan 01 00:00:00 1970 +0000
2241 date: Thu Jan 01 00:00:00 1970 +0000
2238
2242
2239 $ hg log -r null:null
2243 $ hg log -r null:null
2240 changeset: -1:000000000000
2244 changeset: -1:000000000000
2241 user:
2245 user:
2242 date: Thu Jan 01 00:00:00 1970 +0000
2246 date: Thu Jan 01 00:00:00 1970 +0000
2243
2247
2244 working-directory revision requires special treatment
2248 working-directory revision requires special treatment
2245
2249
2246 clean:
2250 clean:
2247
2251
2248 $ hg log -r 'wdir()' --debug
2252 $ hg log -r 'wdir()' --debug
2249 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2253 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2250 phase: draft
2254 phase: draft
2251 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2255 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2252 parent: -1:0000000000000000000000000000000000000000
2256 parent: -1:0000000000000000000000000000000000000000
2253 manifest: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2257 manifest: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2254 user: test
2258 user: test
2255 date: [A-Za-z0-9:+ ]+ (re)
2259 date: [A-Za-z0-9:+ ]+ (re)
2256 extra: branch=default
2260 extra: branch=default
2257
2261
2258 $ hg log -r 'wdir()' -p --stat
2262 $ hg log -r 'wdir()' -p --stat
2259 changeset: 2147483647:ffffffffffff
2263 changeset: 2147483647:ffffffffffff
2260 parent: 0:65624cd9070a
2264 parent: 0:65624cd9070a
2261 user: test
2265 user: test
2262 date: [A-Za-z0-9:+ ]+ (re)
2266 date: [A-Za-z0-9:+ ]+ (re)
2263
2267
2264
2268
2265
2269
2266
2270
2267 dirty:
2271 dirty:
2268
2272
2269 $ echo 2 >> d1/f1
2273 $ echo 2 >> d1/f1
2270 $ echo 2 > d1/f2
2274 $ echo 2 > d1/f2
2271 $ hg add d1/f2
2275 $ hg add d1/f2
2272 $ hg remove .d6/f1
2276 $ hg remove .d6/f1
2273 $ hg status
2277 $ hg status
2274 M d1/f1
2278 M d1/f1
2275 A d1/f2
2279 A d1/f2
2276 R .d6/f1
2280 R .d6/f1
2277
2281
2278 $ hg log -r 'wdir()'
2282 $ hg log -r 'wdir()'
2279 changeset: 2147483647:ffffffffffff
2283 changeset: 2147483647:ffffffffffff
2280 parent: 0:65624cd9070a
2284 parent: 0:65624cd9070a
2281 user: test
2285 user: test
2282 date: [A-Za-z0-9:+ ]+ (re)
2286 date: [A-Za-z0-9:+ ]+ (re)
2283
2287
2284 $ hg log -r 'wdir()' -q
2288 $ hg log -r 'wdir()' -q
2285 2147483647:ffffffffffff
2289 2147483647:ffffffffffff
2286
2290
2287 $ hg log -r 'wdir()' --debug
2291 $ hg log -r 'wdir()' --debug
2288 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2292 changeset: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2289 phase: draft
2293 phase: draft
2290 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2294 parent: 0:65624cd9070a035fa7191a54f2b8af39f16b0c08
2291 parent: -1:0000000000000000000000000000000000000000
2295 parent: -1:0000000000000000000000000000000000000000
2292 manifest: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2296 manifest: 2147483647:ffffffffffffffffffffffffffffffffffffffff
2293 user: test
2297 user: test
2294 date: [A-Za-z0-9:+ ]+ (re)
2298 date: [A-Za-z0-9:+ ]+ (re)
2295 files: d1/f1
2299 files: d1/f1
2296 files+: d1/f2
2300 files+: d1/f2
2297 files-: .d6/f1
2301 files-: .d6/f1
2298 extra: branch=default
2302 extra: branch=default
2299
2303
2300 $ hg log -r 'wdir()' -p --stat --git
2304 $ hg log -r 'wdir()' -p --stat --git
2301 changeset: 2147483647:ffffffffffff
2305 changeset: 2147483647:ffffffffffff
2302 parent: 0:65624cd9070a
2306 parent: 0:65624cd9070a
2303 user: test
2307 user: test
2304 date: [A-Za-z0-9:+ ]+ (re)
2308 date: [A-Za-z0-9:+ ]+ (re)
2305
2309
2306 .d6/f1 | 1 -
2310 .d6/f1 | 1 -
2307 d1/f1 | 1 +
2311 d1/f1 | 1 +
2308 d1/f2 | 1 +
2312 d1/f2 | 1 +
2309 3 files changed, 2 insertions(+), 1 deletions(-)
2313 3 files changed, 2 insertions(+), 1 deletions(-)
2310
2314
2311 diff --git a/.d6/f1 b/.d6/f1
2315 diff --git a/.d6/f1 b/.d6/f1
2312 deleted file mode 100644
2316 deleted file mode 100644
2313 --- a/.d6/f1
2317 --- a/.d6/f1
2314 +++ /dev/null
2318 +++ /dev/null
2315 @@ -1,1 +0,0 @@
2319 @@ -1,1 +0,0 @@
2316 -1
2320 -1
2317 diff --git a/d1/f1 b/d1/f1
2321 diff --git a/d1/f1 b/d1/f1
2318 --- a/d1/f1
2322 --- a/d1/f1
2319 +++ b/d1/f1
2323 +++ b/d1/f1
2320 @@ -1,1 +1,2 @@
2324 @@ -1,1 +1,2 @@
2321 1
2325 1
2322 +2
2326 +2
2323 diff --git a/d1/f2 b/d1/f2
2327 diff --git a/d1/f2 b/d1/f2
2324 new file mode 100644
2328 new file mode 100644
2325 --- /dev/null
2329 --- /dev/null
2326 +++ b/d1/f2
2330 +++ b/d1/f2
2327 @@ -0,0 +1,1 @@
2331 @@ -0,0 +1,1 @@
2328 +2
2332 +2
2329
2333
2330 $ hg log -r 'wdir()' -Tjson
2334 $ hg log -r 'wdir()' -Tjson
2331 [
2335 [
2332 {
2336 {
2333 "bookmarks": [],
2337 "bookmarks": [],
2334 "branch": "default",
2338 "branch": "default",
2335 "date": [*, 0], (glob)
2339 "date": [*, 0], (glob)
2336 "desc": "",
2340 "desc": "",
2337 "node": "ffffffffffffffffffffffffffffffffffffffff",
2341 "node": "ffffffffffffffffffffffffffffffffffffffff",
2338 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2342 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2339 "phase": "draft",
2343 "phase": "draft",
2340 "rev": 2147483647,
2344 "rev": 2147483647,
2341 "tags": [],
2345 "tags": [],
2342 "user": "test"
2346 "user": "test"
2343 }
2347 }
2344 ]
2348 ]
2345
2349
2346 $ hg log -r 'wdir()' -Tjson -q
2350 $ hg log -r 'wdir()' -Tjson -q
2347 [
2351 [
2348 {
2352 {
2349 "node": "ffffffffffffffffffffffffffffffffffffffff",
2353 "node": "ffffffffffffffffffffffffffffffffffffffff",
2350 "rev": 2147483647
2354 "rev": 2147483647
2351 }
2355 }
2352 ]
2356 ]
2353
2357
2354 $ hg log -r 'wdir()' -Tjson --debug
2358 $ hg log -r 'wdir()' -Tjson --debug
2355 [
2359 [
2356 {
2360 {
2357 "added": ["d1/f2"],
2361 "added": ["d1/f2"],
2358 "bookmarks": [],
2362 "bookmarks": [],
2359 "branch": "default",
2363 "branch": "default",
2360 "date": [*, 0], (glob)
2364 "date": [*, 0], (glob)
2361 "desc": "",
2365 "desc": "",
2362 "extra": {"branch": "default"},
2366 "extra": {"branch": "default"},
2363 "manifest": "ffffffffffffffffffffffffffffffffffffffff",
2367 "manifest": "ffffffffffffffffffffffffffffffffffffffff",
2364 "modified": ["d1/f1"],
2368 "modified": ["d1/f1"],
2365 "node": "ffffffffffffffffffffffffffffffffffffffff",
2369 "node": "ffffffffffffffffffffffffffffffffffffffff",
2366 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2370 "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
2367 "phase": "draft",
2371 "phase": "draft",
2368 "removed": [".d6/f1"],
2372 "removed": [".d6/f1"],
2369 "rev": 2147483647,
2373 "rev": 2147483647,
2370 "tags": [],
2374 "tags": [],
2371 "user": "test"
2375 "user": "test"
2372 }
2376 }
2373 ]
2377 ]
2374
2378
2375 follow files from wdir
2379 follow files from wdir
2376
2380
2377 $ hg cp d1/f1 f1-copy
2381 $ hg cp d1/f1 f1-copy
2378 $ hg stat --all
2382 $ hg stat --all
2379 M d1/f1
2383 M d1/f1
2380 A d1/f2
2384 A d1/f2
2381 A f1-copy
2385 A f1-copy
2382 d1/f1
2386 d1/f1
2383 R .d6/f1
2387 R .d6/f1
2384 C D2/f1
2388 C D2/f1
2385 C D3.i/f1
2389 C D3.i/f1
2386 C d4.hg/f1
2390 C d4.hg/f1
2387 C d5.d/f1
2391 C d5.d/f1
2388
2392
2389 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d5.d/f1
2393 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d5.d/f1
2390 == 2147483647 ==
2394 == 2147483647 ==
2391
2395
2392 == 0 ==
2396 == 0 ==
2393 d5.d/f1 | 1 +
2397 d5.d/f1 | 1 +
2394 1 files changed, 1 insertions(+), 0 deletions(-)
2398 1 files changed, 1 insertions(+), 0 deletions(-)
2395
2399
2396
2400
2397 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d1/f1
2401 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d1/f1
2398 == 2147483647 ==
2402 == 2147483647 ==
2399 d1/f1 | 1 +
2403 d1/f1 | 1 +
2400 1 files changed, 1 insertions(+), 0 deletions(-)
2404 1 files changed, 1 insertions(+), 0 deletions(-)
2401
2405
2402 == 0 ==
2406 == 0 ==
2403 d1/f1 | 1 +
2407 d1/f1 | 1 +
2404 1 files changed, 1 insertions(+), 0 deletions(-)
2408 1 files changed, 1 insertions(+), 0 deletions(-)
2405
2409
2406
2410
2407 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d1/f2
2411 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d1/f2
2408 == 2147483647 ==
2412 == 2147483647 ==
2409 d1/f2 | 1 +
2413 d1/f2 | 1 +
2410 1 files changed, 1 insertions(+), 0 deletions(-)
2414 1 files changed, 1 insertions(+), 0 deletions(-)
2411
2415
2412
2416
2413 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat f1-copy
2417 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat f1-copy
2414 == 2147483647 ==
2418 == 2147483647 ==
2415 f1-copy | 1 +
2419 f1-copy | 1 +
2416 1 files changed, 1 insertions(+), 0 deletions(-)
2420 1 files changed, 1 insertions(+), 0 deletions(-)
2417
2421
2418 == 0 ==
2422 == 0 ==
2419 d1/f1 | 1 +
2423 d1/f1 | 1 +
2420 1 files changed, 1 insertions(+), 0 deletions(-)
2424 1 files changed, 1 insertions(+), 0 deletions(-)
2421
2425
2422
2426
2423 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat notfound
2427 $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat notfound
2424 abort: cannot follow file not in any of the specified revisions: "notfound"
2428 abort: cannot follow file not in any of the specified revisions: "notfound"
2425 [20]
2429 [20]
2426
2430
2427 follow files from wdir and non-wdir revision:
2431 follow files from wdir and non-wdir revision:
2428
2432
2429 $ hg log -T '{rev}\n' -fr'wdir()+.' f1-copy
2433 $ hg log -T '{rev}\n' -fr'wdir()+.' f1-copy
2430 f1-copy: no such file in rev 65624cd9070a
2434 f1-copy: no such file in rev 65624cd9070a
2431 2147483647
2435 2147483647
2432 0
2436 0
2433
2437
2434 follow added/removed files from wdir parent
2438 follow added/removed files from wdir parent
2435
2439
2436 $ hg log -T '{rev}\n' -f d1/f2
2440 $ hg log -T '{rev}\n' -f d1/f2
2437 abort: cannot follow nonexistent file: "d1/f2"
2441 abort: cannot follow nonexistent file: "d1/f2"
2438 [20]
2442 [20]
2439
2443
2440 $ hg log -T '{rev}\n' -f f1-copy
2444 $ hg log -T '{rev}\n' -f f1-copy
2441 abort: cannot follow nonexistent file: "f1-copy"
2445 abort: cannot follow nonexistent file: "f1-copy"
2442 [20]
2446 [20]
2443
2447
2444 $ hg log -T '{rev}\n' -f .d6/f1
2448 $ hg log -T '{rev}\n' -f .d6/f1
2445 abort: cannot follow file not in parent revision: ".d6/f1"
2449 abort: cannot follow file not in parent revision: ".d6/f1"
2446 [20]
2450 [20]
2447
2451
2448 $ hg revert -aqC
2452 $ hg revert -aqC
2449
2453
2450 Check that adding an arbitrary name shows up in log automatically
2454 Check that adding an arbitrary name shows up in log automatically
2451
2455
2452 $ cat > ../names.py <<EOF
2456 $ cat > ../names.py <<EOF
2453 > """A small extension to test adding arbitrary names to a repo"""
2457 > """A small extension to test adding arbitrary names to a repo"""
2454 > from mercurial import namespaces
2458 > from mercurial import namespaces
2455 >
2459 >
2456 > def reposetup(ui, repo):
2460 > def reposetup(ui, repo):
2457 > if not repo.local():
2461 > if not repo.local():
2458 > return
2462 > return
2459 > foo = {b'foo': repo[0].node()}
2463 > foo = {b'foo': repo[0].node()}
2460 > names = lambda r: foo.keys()
2464 > names = lambda r: foo.keys()
2461 > namemap = lambda r, name: foo.get(name)
2465 > namemap = lambda r, name: foo.get(name)
2462 > nodemap = lambda r, node: [name for name, n in foo.items()
2466 > nodemap = lambda r, node: [name for name, n in foo.items()
2463 > if n == node]
2467 > if n == node]
2464 > ns = namespaces.namespace(
2468 > ns = namespaces.namespace(
2465 > b"bars", templatename=b"bar", logname=b"barlog",
2469 > b"bars", templatename=b"bar", logname=b"barlog",
2466 > colorname=b"barcolor", listnames=names, namemap=namemap,
2470 > colorname=b"barcolor", listnames=names, namemap=namemap,
2467 > nodemap=nodemap)
2471 > nodemap=nodemap)
2468 >
2472 >
2469 > repo.names.addnamespace(ns)
2473 > repo.names.addnamespace(ns)
2470 > EOF
2474 > EOF
2471
2475
2472 $ hg --config extensions.names=../names.py log -r 0
2476 $ hg --config extensions.names=../names.py log -r 0
2473 changeset: 0:65624cd9070a
2477 changeset: 0:65624cd9070a
2474 tag: tip
2478 tag: tip
2475 barlog: foo
2479 barlog: foo
2476 user: test
2480 user: test
2477 date: Thu Jan 01 00:00:00 1970 +0000
2481 date: Thu Jan 01 00:00:00 1970 +0000
2478 summary: a bunch of weird directories
2482 summary: a bunch of weird directories
2479
2483
2480 $ hg --config extensions.names=../names.py \
2484 $ hg --config extensions.names=../names.py \
2481 > --config extensions.color= --config color.log.barcolor=red \
2485 > --config extensions.color= --config color.log.barcolor=red \
2482 > --color=always log -r 0
2486 > --color=always log -r 0
2483 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
2487 \x1b[0;33mchangeset: 0:65624cd9070a\x1b[0m (esc)
2484 tag: tip
2488 tag: tip
2485 \x1b[0;31mbarlog: foo\x1b[0m (esc)
2489 \x1b[0;31mbarlog: foo\x1b[0m (esc)
2486 user: test
2490 user: test
2487 date: Thu Jan 01 00:00:00 1970 +0000
2491 date: Thu Jan 01 00:00:00 1970 +0000
2488 summary: a bunch of weird directories
2492 summary: a bunch of weird directories
2489
2493
2490 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
2494 $ hg --config extensions.names=../names.py log -r 0 --template '{bars}\n'
2491 foo
2495 foo
2492
2496
2493 Templater parse errors:
2497 Templater parse errors:
2494
2498
2495 simple error
2499 simple error
2496 $ hg log -r . -T '{shortest(node}'
2500 $ hg log -r . -T '{shortest(node}'
2497 hg: parse error at 14: unexpected token: end
2501 hg: parse error at 14: unexpected token: end
2498 ({shortest(node}
2502 ({shortest(node}
2499 ^ here)
2503 ^ here)
2500 [10]
2504 [10]
2501
2505
2502 multi-line template with error
2506 multi-line template with error
2503 $ hg log -r . -T 'line 1
2507 $ hg log -r . -T 'line 1
2504 > line2
2508 > line2
2505 > {shortest(node}
2509 > {shortest(node}
2506 > line4\nline5'
2510 > line4\nline5'
2507 hg: parse error at 27: unexpected token: end
2511 hg: parse error at 27: unexpected token: end
2508 (line 1\nline2\n{shortest(node}\nline4\nline5
2512 (line 1\nline2\n{shortest(node}\nline4\nline5
2509 ^ here)
2513 ^ here)
2510 [10]
2514 [10]
2511
2515
2512 $ cd ..
2516 $ cd ..
2513
2517
2514 New namespace is registered per repo instance, but the template keyword
2518 New namespace is registered per repo instance, but the template keyword
2515 is global. So we shouldn't expect the namespace always exists. Using
2519 is global. So we shouldn't expect the namespace always exists. Using
2516 ssh:// makes sure a bundle repository is created from scratch. (issue6301)
2520 ssh:// makes sure a bundle repository is created from scratch. (issue6301)
2517
2521
2518 $ hg clone -qr0 "ssh://user@dummy/`pwd`/a" a-clone
2522 $ hg clone -qr0 "ssh://user@dummy/`pwd`/a" a-clone
2519 $ hg incoming --config extensions.names=names.py -R a-clone \
2523 $ hg incoming --config extensions.names=names.py -R a-clone \
2520 > -T '{bars}\n' -l1
2524 > -T '{bars}\n' -l1
2521 comparing with ssh://user@dummy/$TESTTMP/a
2525 comparing with ssh://user@dummy/$TESTTMP/a
2522 searching for changes
2526 searching for changes
2523
2527
2524
2528
2525 hg log -f dir across branches
2529 hg log -f dir across branches
2526
2530
2527 $ hg init acrossbranches
2531 $ hg init acrossbranches
2528 $ cd acrossbranches
2532 $ cd acrossbranches
2529 $ mkdir d
2533 $ mkdir d
2530 $ echo a > d/a && hg ci -Aqm a
2534 $ echo a > d/a && hg ci -Aqm a
2531 $ echo b > d/a && hg ci -Aqm b
2535 $ echo b > d/a && hg ci -Aqm b
2532 $ hg up -q 0
2536 $ hg up -q 0
2533 $ echo b > d/a && hg ci -Aqm c
2537 $ echo b > d/a && hg ci -Aqm c
2534 $ hg log -f d -T '{desc}' -G
2538 $ hg log -f d -T '{desc}' -G
2535 @ c
2539 @ c
2536 |
2540 |
2537 o a
2541 o a
2538
2542
2539 Ensure that largefiles doesn't interfere with following a normal file
2543 Ensure that largefiles doesn't interfere with following a normal file
2540 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
2544 $ hg --config extensions.largefiles= log -f d -T '{desc}' -G
2541 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
2545 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
2542 @ c
2546 @ c
2543 |
2547 |
2544 o a
2548 o a
2545
2549
2546 $ hg log -f d/a -T '{desc}' -G
2550 $ hg log -f d/a -T '{desc}' -G
2547 @ c
2551 @ c
2548 |
2552 |
2549 o a
2553 o a
2550
2554
2551 $ cd ..
2555 $ cd ..
2552
2556
2553 hg log -f with linkrev pointing to another branch
2557 hg log -f with linkrev pointing to another branch
2554 -------------------------------------------------
2558 -------------------------------------------------
2555
2559
2556 create history with a filerev whose linkrev points to another branch
2560 create history with a filerev whose linkrev points to another branch
2557
2561
2558 $ hg init branchedlinkrev
2562 $ hg init branchedlinkrev
2559 $ cd branchedlinkrev
2563 $ cd branchedlinkrev
2560 $ echo 1 > a
2564 $ echo 1 > a
2561 $ hg commit -Am 'content1'
2565 $ hg commit -Am 'content1'
2562 adding a
2566 adding a
2563 $ echo 2 > a
2567 $ echo 2 > a
2564 $ hg commit -m 'content2'
2568 $ hg commit -m 'content2'
2565 $ hg up --rev 'desc(content1)'
2569 $ hg up --rev 'desc(content1)'
2566 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2570 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2567 $ echo unrelated > unrelated
2571 $ echo unrelated > unrelated
2568 $ hg commit -Am 'unrelated'
2572 $ hg commit -Am 'unrelated'
2569 adding unrelated
2573 adding unrelated
2570 created new head
2574 created new head
2571 $ hg graft -r 'desc(content2)'
2575 $ hg graft -r 'desc(content2)'
2572 grafting 1:2294ae80ad84 "content2"
2576 grafting 1:2294ae80ad84 "content2"
2573 $ echo 3 > a
2577 $ echo 3 > a
2574 $ hg commit -m 'content3'
2578 $ hg commit -m 'content3'
2575 $ hg log -G
2579 $ hg log -G
2576 @ changeset: 4:50b9b36e9c5d
2580 @ changeset: 4:50b9b36e9c5d
2577 | tag: tip
2581 | tag: tip
2578 | user: test
2582 | user: test
2579 | date: Thu Jan 01 00:00:00 1970 +0000
2583 | date: Thu Jan 01 00:00:00 1970 +0000
2580 | summary: content3
2584 | summary: content3
2581 |
2585 |
2582 o changeset: 3:15b2327059e5
2586 o changeset: 3:15b2327059e5
2583 | user: test
2587 | user: test
2584 | date: Thu Jan 01 00:00:00 1970 +0000
2588 | date: Thu Jan 01 00:00:00 1970 +0000
2585 | summary: content2
2589 | summary: content2
2586 |
2590 |
2587 o changeset: 2:2029acd1168c
2591 o changeset: 2:2029acd1168c
2588 | parent: 0:ae0a3c9f9e95
2592 | parent: 0:ae0a3c9f9e95
2589 | user: test
2593 | user: test
2590 | date: Thu Jan 01 00:00:00 1970 +0000
2594 | date: Thu Jan 01 00:00:00 1970 +0000
2591 | summary: unrelated
2595 | summary: unrelated
2592 |
2596 |
2593 | o changeset: 1:2294ae80ad84
2597 | o changeset: 1:2294ae80ad84
2594 |/ user: test
2598 |/ user: test
2595 | date: Thu Jan 01 00:00:00 1970 +0000
2599 | date: Thu Jan 01 00:00:00 1970 +0000
2596 | summary: content2
2600 | summary: content2
2597 |
2601 |
2598 o changeset: 0:ae0a3c9f9e95
2602 o changeset: 0:ae0a3c9f9e95
2599 user: test
2603 user: test
2600 date: Thu Jan 01 00:00:00 1970 +0000
2604 date: Thu Jan 01 00:00:00 1970 +0000
2601 summary: content1
2605 summary: content1
2602
2606
2603
2607
2604 log -f on the file should list the graft result.
2608 log -f on the file should list the graft result.
2605
2609
2606 $ hg log -Gf a
2610 $ hg log -Gf a
2607 @ changeset: 4:50b9b36e9c5d
2611 @ changeset: 4:50b9b36e9c5d
2608 | tag: tip
2612 | tag: tip
2609 | user: test
2613 | user: test
2610 | date: Thu Jan 01 00:00:00 1970 +0000
2614 | date: Thu Jan 01 00:00:00 1970 +0000
2611 | summary: content3
2615 | summary: content3
2612 |
2616 |
2613 o changeset: 3:15b2327059e5
2617 o changeset: 3:15b2327059e5
2614 : user: test
2618 : user: test
2615 : date: Thu Jan 01 00:00:00 1970 +0000
2619 : date: Thu Jan 01 00:00:00 1970 +0000
2616 : summary: content2
2620 : summary: content2
2617 :
2621 :
2618 o changeset: 0:ae0a3c9f9e95
2622 o changeset: 0:ae0a3c9f9e95
2619 user: test
2623 user: test
2620 date: Thu Jan 01 00:00:00 1970 +0000
2624 date: Thu Jan 01 00:00:00 1970 +0000
2621 summary: content1
2625 summary: content1
2622
2626
2623
2627
2624 plain log lists the original version
2628 plain log lists the original version
2625 (XXX we should probably list both)
2629 (XXX we should probably list both)
2626
2630
2627 $ hg log -G a
2631 $ hg log -G a
2628 @ changeset: 4:50b9b36e9c5d
2632 @ changeset: 4:50b9b36e9c5d
2629 : tag: tip
2633 : tag: tip
2630 : user: test
2634 : user: test
2631 : date: Thu Jan 01 00:00:00 1970 +0000
2635 : date: Thu Jan 01 00:00:00 1970 +0000
2632 : summary: content3
2636 : summary: content3
2633 :
2637 :
2634 : o changeset: 1:2294ae80ad84
2638 : o changeset: 1:2294ae80ad84
2635 :/ user: test
2639 :/ user: test
2636 : date: Thu Jan 01 00:00:00 1970 +0000
2640 : date: Thu Jan 01 00:00:00 1970 +0000
2637 : summary: content2
2641 : summary: content2
2638 :
2642 :
2639 o changeset: 0:ae0a3c9f9e95
2643 o changeset: 0:ae0a3c9f9e95
2640 user: test
2644 user: test
2641 date: Thu Jan 01 00:00:00 1970 +0000
2645 date: Thu Jan 01 00:00:00 1970 +0000
2642 summary: content1
2646 summary: content1
2643
2647
2644
2648
2645 hg log -f from the grafted changeset
2649 hg log -f from the grafted changeset
2646 (The bootstrap should properly take the topology in account)
2650 (The bootstrap should properly take the topology in account)
2647
2651
2648 $ hg up 'desc(content3)^'
2652 $ hg up 'desc(content3)^'
2649 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2653 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2650 $ hg log -Gf a
2654 $ hg log -Gf a
2651 @ changeset: 3:15b2327059e5
2655 @ changeset: 3:15b2327059e5
2652 : user: test
2656 : user: test
2653 : date: Thu Jan 01 00:00:00 1970 +0000
2657 : date: Thu Jan 01 00:00:00 1970 +0000
2654 : summary: content2
2658 : summary: content2
2655 :
2659 :
2656 o changeset: 0:ae0a3c9f9e95
2660 o changeset: 0:ae0a3c9f9e95
2657 user: test
2661 user: test
2658 date: Thu Jan 01 00:00:00 1970 +0000
2662 date: Thu Jan 01 00:00:00 1970 +0000
2659 summary: content1
2663 summary: content1
2660
2664
2661
2665
2662 Test that we use the first non-hidden changeset in that case.
2666 Test that we use the first non-hidden changeset in that case.
2663
2667
2664 (hide the changeset)
2668 (hide the changeset)
2665
2669
2666 $ hg log -T '{node}\n' -r 1
2670 $ hg log -T '{node}\n' -r 1
2667 2294ae80ad8447bc78383182eeac50cb049df623
2671 2294ae80ad8447bc78383182eeac50cb049df623
2668 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
2672 $ hg debugobsolete 2294ae80ad8447bc78383182eeac50cb049df623
2669 1 new obsolescence markers
2673 1 new obsolescence markers
2670 obsoleted 1 changesets
2674 obsoleted 1 changesets
2671 $ hg log -G
2675 $ hg log -G
2672 o changeset: 4:50b9b36e9c5d
2676 o changeset: 4:50b9b36e9c5d
2673 | tag: tip
2677 | tag: tip
2674 | user: test
2678 | user: test
2675 | date: Thu Jan 01 00:00:00 1970 +0000
2679 | date: Thu Jan 01 00:00:00 1970 +0000
2676 | summary: content3
2680 | summary: content3
2677 |
2681 |
2678 @ changeset: 3:15b2327059e5
2682 @ changeset: 3:15b2327059e5
2679 | user: test
2683 | user: test
2680 | date: Thu Jan 01 00:00:00 1970 +0000
2684 | date: Thu Jan 01 00:00:00 1970 +0000
2681 | summary: content2
2685 | summary: content2
2682 |
2686 |
2683 o changeset: 2:2029acd1168c
2687 o changeset: 2:2029acd1168c
2684 | parent: 0:ae0a3c9f9e95
2688 | parent: 0:ae0a3c9f9e95
2685 | user: test
2689 | user: test
2686 | date: Thu Jan 01 00:00:00 1970 +0000
2690 | date: Thu Jan 01 00:00:00 1970 +0000
2687 | summary: unrelated
2691 | summary: unrelated
2688 |
2692 |
2689 o changeset: 0:ae0a3c9f9e95
2693 o changeset: 0:ae0a3c9f9e95
2690 user: test
2694 user: test
2691 date: Thu Jan 01 00:00:00 1970 +0000
2695 date: Thu Jan 01 00:00:00 1970 +0000
2692 summary: content1
2696 summary: content1
2693
2697
2694
2698
2695 Check that log on the file does not drop the file revision.
2699 Check that log on the file does not drop the file revision.
2696
2700
2697 $ hg log -G a
2701 $ hg log -G a
2698 o changeset: 4:50b9b36e9c5d
2702 o changeset: 4:50b9b36e9c5d
2699 | tag: tip
2703 | tag: tip
2700 | user: test
2704 | user: test
2701 | date: Thu Jan 01 00:00:00 1970 +0000
2705 | date: Thu Jan 01 00:00:00 1970 +0000
2702 | summary: content3
2706 | summary: content3
2703 |
2707 |
2704 @ changeset: 3:15b2327059e5
2708 @ changeset: 3:15b2327059e5
2705 : user: test
2709 : user: test
2706 : date: Thu Jan 01 00:00:00 1970 +0000
2710 : date: Thu Jan 01 00:00:00 1970 +0000
2707 : summary: content2
2711 : summary: content2
2708 :
2712 :
2709 o changeset: 0:ae0a3c9f9e95
2713 o changeset: 0:ae0a3c9f9e95
2710 user: test
2714 user: test
2711 date: Thu Jan 01 00:00:00 1970 +0000
2715 date: Thu Jan 01 00:00:00 1970 +0000
2712 summary: content1
2716 summary: content1
2713
2717
2714
2718
2715 Even when a head revision is linkrev-shadowed.
2719 Even when a head revision is linkrev-shadowed.
2716
2720
2717 $ hg log -T '{node}\n' -r 4
2721 $ hg log -T '{node}\n' -r 4
2718 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2722 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2719 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2723 $ hg debugobsolete 50b9b36e9c5df2c6fc6dcefa8ad0da929e84aed2
2720 1 new obsolescence markers
2724 1 new obsolescence markers
2721 obsoleted 1 changesets
2725 obsoleted 1 changesets
2722 $ hg log -G a
2726 $ hg log -G a
2723 @ changeset: 3:15b2327059e5
2727 @ changeset: 3:15b2327059e5
2724 : tag: tip
2728 : tag: tip
2725 : user: test
2729 : user: test
2726 : date: Thu Jan 01 00:00:00 1970 +0000
2730 : date: Thu Jan 01 00:00:00 1970 +0000
2727 : summary: content2
2731 : summary: content2
2728 :
2732 :
2729 o changeset: 0:ae0a3c9f9e95
2733 o changeset: 0:ae0a3c9f9e95
2730 user: test
2734 user: test
2731 date: Thu Jan 01 00:00:00 1970 +0000
2735 date: Thu Jan 01 00:00:00 1970 +0000
2732 summary: content1
2736 summary: content1
2733
2737
2734
2738
2735 $ cd ..
2739 $ cd ..
2736
2740
2737 Even when the file revision is missing from some head:
2741 Even when the file revision is missing from some head:
2738
2742
2739 $ hg init issue4490
2743 $ hg init issue4490
2740 $ cd issue4490
2744 $ cd issue4490
2741 $ echo '[experimental]' >> .hg/hgrc
2745 $ echo '[experimental]' >> .hg/hgrc
2742 $ echo 'evolution.createmarkers=True' >> .hg/hgrc
2746 $ echo 'evolution.createmarkers=True' >> .hg/hgrc
2743 $ echo a > a
2747 $ echo a > a
2744 $ hg ci -Am0
2748 $ hg ci -Am0
2745 adding a
2749 adding a
2746 $ echo b > b
2750 $ echo b > b
2747 $ hg ci -Am1
2751 $ hg ci -Am1
2748 adding b
2752 adding b
2749 $ echo B > b
2753 $ echo B > b
2750 $ hg ci --amend -m 1
2754 $ hg ci --amend -m 1
2751 $ hg up 0
2755 $ hg up 0
2752 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2756 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2753 $ echo c > c
2757 $ echo c > c
2754 $ hg ci -Am2
2758 $ hg ci -Am2
2755 adding c
2759 adding c
2756 created new head
2760 created new head
2757 $ hg up 'head() and not .'
2761 $ hg up 'head() and not .'
2758 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
2762 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
2759 $ hg log -G
2763 $ hg log -G
2760 o changeset: 3:db815d6d32e6
2764 o changeset: 3:db815d6d32e6
2761 | tag: tip
2765 | tag: tip
2762 | parent: 0:f7b1eb17ad24
2766 | parent: 0:f7b1eb17ad24
2763 | user: test
2767 | user: test
2764 | date: Thu Jan 01 00:00:00 1970 +0000
2768 | date: Thu Jan 01 00:00:00 1970 +0000
2765 | summary: 2
2769 | summary: 2
2766 |
2770 |
2767 | @ changeset: 2:9bc8ce7f9356
2771 | @ changeset: 2:9bc8ce7f9356
2768 |/ parent: 0:f7b1eb17ad24
2772 |/ parent: 0:f7b1eb17ad24
2769 | user: test
2773 | user: test
2770 | date: Thu Jan 01 00:00:00 1970 +0000
2774 | date: Thu Jan 01 00:00:00 1970 +0000
2771 | summary: 1
2775 | summary: 1
2772 |
2776 |
2773 o changeset: 0:f7b1eb17ad24
2777 o changeset: 0:f7b1eb17ad24
2774 user: test
2778 user: test
2775 date: Thu Jan 01 00:00:00 1970 +0000
2779 date: Thu Jan 01 00:00:00 1970 +0000
2776 summary: 0
2780 summary: 0
2777
2781
2778 $ hg log -f -G b
2782 $ hg log -f -G b
2779 @ changeset: 2:9bc8ce7f9356
2783 @ changeset: 2:9bc8ce7f9356
2780 | parent: 0:f7b1eb17ad24
2784 | parent: 0:f7b1eb17ad24
2781 ~ user: test
2785 ~ user: test
2782 date: Thu Jan 01 00:00:00 1970 +0000
2786 date: Thu Jan 01 00:00:00 1970 +0000
2783 summary: 1
2787 summary: 1
2784
2788
2785 $ hg log -G b
2789 $ hg log -G b
2786 @ changeset: 2:9bc8ce7f9356
2790 @ changeset: 2:9bc8ce7f9356
2787 | parent: 0:f7b1eb17ad24
2791 | parent: 0:f7b1eb17ad24
2788 ~ user: test
2792 ~ user: test
2789 date: Thu Jan 01 00:00:00 1970 +0000
2793 date: Thu Jan 01 00:00:00 1970 +0000
2790 summary: 1
2794 summary: 1
2791
2795
2792 $ cd ..
2796 $ cd ..
2793
2797
2794 Check proper report when the manifest changes but not the file issue4499
2798 Check proper report when the manifest changes but not the file issue4499
2795 ------------------------------------------------------------------------
2799 ------------------------------------------------------------------------
2796
2800
2797 $ hg init issue4499
2801 $ hg init issue4499
2798 $ cd issue4499
2802 $ cd issue4499
2799 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
2803 $ for f in A B C D F E G H I J K L M N O P Q R S T U; do
2800 > echo 1 > $f;
2804 > echo 1 > $f;
2801 > hg add $f;
2805 > hg add $f;
2802 > done
2806 > done
2803 $ hg commit -m 'A1B1C1'
2807 $ hg commit -m 'A1B1C1'
2804 $ echo 2 > A
2808 $ echo 2 > A
2805 $ echo 2 > B
2809 $ echo 2 > B
2806 $ echo 2 > C
2810 $ echo 2 > C
2807 $ hg commit -m 'A2B2C2'
2811 $ hg commit -m 'A2B2C2'
2808 $ hg up 0
2812 $ hg up 0
2809 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2813 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
2810 $ echo 3 > A
2814 $ echo 3 > A
2811 $ echo 2 > B
2815 $ echo 2 > B
2812 $ echo 2 > C
2816 $ echo 2 > C
2813 $ hg commit -m 'A3B2C2'
2817 $ hg commit -m 'A3B2C2'
2814 created new head
2818 created new head
2815
2819
2816 $ hg log -G
2820 $ hg log -G
2817 @ changeset: 2:fe5fc3d0eb17
2821 @ changeset: 2:fe5fc3d0eb17
2818 | tag: tip
2822 | tag: tip
2819 | parent: 0:abf4f0e38563
2823 | parent: 0:abf4f0e38563
2820 | user: test
2824 | user: test
2821 | date: Thu Jan 01 00:00:00 1970 +0000
2825 | date: Thu Jan 01 00:00:00 1970 +0000
2822 | summary: A3B2C2
2826 | summary: A3B2C2
2823 |
2827 |
2824 | o changeset: 1:07dcc6b312c0
2828 | o changeset: 1:07dcc6b312c0
2825 |/ user: test
2829 |/ user: test
2826 | date: Thu Jan 01 00:00:00 1970 +0000
2830 | date: Thu Jan 01 00:00:00 1970 +0000
2827 | summary: A2B2C2
2831 | summary: A2B2C2
2828 |
2832 |
2829 o changeset: 0:abf4f0e38563
2833 o changeset: 0:abf4f0e38563
2830 user: test
2834 user: test
2831 date: Thu Jan 01 00:00:00 1970 +0000
2835 date: Thu Jan 01 00:00:00 1970 +0000
2832 summary: A1B1C1
2836 summary: A1B1C1
2833
2837
2834
2838
2835 Log -f on B should reports current changesets
2839 Log -f on B should reports current changesets
2836
2840
2837 $ hg log -fG B
2841 $ hg log -fG B
2838 @ changeset: 2:fe5fc3d0eb17
2842 @ changeset: 2:fe5fc3d0eb17
2839 | tag: tip
2843 | tag: tip
2840 | parent: 0:abf4f0e38563
2844 | parent: 0:abf4f0e38563
2841 | user: test
2845 | user: test
2842 | date: Thu Jan 01 00:00:00 1970 +0000
2846 | date: Thu Jan 01 00:00:00 1970 +0000
2843 | summary: A3B2C2
2847 | summary: A3B2C2
2844 |
2848 |
2845 o changeset: 0:abf4f0e38563
2849 o changeset: 0:abf4f0e38563
2846 user: test
2850 user: test
2847 date: Thu Jan 01 00:00:00 1970 +0000
2851 date: Thu Jan 01 00:00:00 1970 +0000
2848 summary: A1B1C1
2852 summary: A1B1C1
2849
2853
2850 $ cd ..
2854 $ cd ..
2851
2855
2852 --- going to test line wrap fix on using both --stat and -G (issue5800)
2856 --- going to test line wrap fix on using both --stat and -G (issue5800)
2853 $ hg init issue5800
2857 $ hg init issue5800
2854 $ cd issue5800
2858 $ cd issue5800
2855 $ touch a
2859 $ touch a
2856 $ hg ci -Am 'add a'
2860 $ hg ci -Am 'add a'
2857 adding a
2861 adding a
2858 ---- now we are going to add 300 lines to a
2862 ---- now we are going to add 300 lines to a
2859 $ for i in `$TESTDIR/seq.py 1 300`; do echo $i >> a; done
2863 $ for i in `$TESTDIR/seq.py 1 300`; do echo $i >> a; done
2860 $ hg ci -m 'modify a'
2864 $ hg ci -m 'modify a'
2861 $ hg log
2865 $ hg log
2862 changeset: 1:a98683e6a834
2866 changeset: 1:a98683e6a834
2863 tag: tip
2867 tag: tip
2864 user: test
2868 user: test
2865 date: Thu Jan 01 00:00:00 1970 +0000
2869 date: Thu Jan 01 00:00:00 1970 +0000
2866 summary: modify a
2870 summary: modify a
2867
2871
2868 changeset: 0:ac82d8b1f7c4
2872 changeset: 0:ac82d8b1f7c4
2869 user: test
2873 user: test
2870 date: Thu Jan 01 00:00:00 1970 +0000
2874 date: Thu Jan 01 00:00:00 1970 +0000
2871 summary: add a
2875 summary: add a
2872
2876
2873 ---- now visualise the changes we made without template
2877 ---- now visualise the changes we made without template
2874 $ hg log -l1 -r a98683e6a834 --stat -G
2878 $ hg log -l1 -r a98683e6a834 --stat -G
2875 @ changeset: 1:a98683e6a834
2879 @ changeset: 1:a98683e6a834
2876 | tag: tip
2880 | tag: tip
2877 ~ user: test
2881 ~ user: test
2878 date: Thu Jan 01 00:00:00 1970 +0000
2882 date: Thu Jan 01 00:00:00 1970 +0000
2879 summary: modify a
2883 summary: modify a
2880
2884
2881 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2885 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2882 1 files changed, 300 insertions(+), 0 deletions(-)
2886 1 files changed, 300 insertions(+), 0 deletions(-)
2883
2887
2884 ---- with template
2888 ---- with template
2885 $ hg log -l1 -r a98683e6a834 --stat -G -T bisect
2889 $ hg log -l1 -r a98683e6a834 --stat -G -T bisect
2886 @ changeset: 1:a98683e6a834
2890 @ changeset: 1:a98683e6a834
2887 | bisect:
2891 | bisect:
2888 ~ tag: tip
2892 ~ tag: tip
2889 user: test
2893 user: test
2890 date: Thu Jan 01 00:00:00 1970 +0000
2894 date: Thu Jan 01 00:00:00 1970 +0000
2891 summary: modify a
2895 summary: modify a
2892
2896
2893 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2897 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2894 1 files changed, 300 insertions(+), 0 deletions(-)
2898 1 files changed, 300 insertions(+), 0 deletions(-)
2895
2899
2896 $ hg log -l1 -r a98683e6a834 --stat -G -T changelog
2900 $ hg log -l1 -r a98683e6a834 --stat -G -T changelog
2897 1970-01-01 test <test>
2901 1970-01-01 test <test>
2898
2902
2899 @ * a:
2903 @ * a:
2900 | modify a
2904 | modify a
2901 ~ [a98683e6a834] [tip]
2905 ~ [a98683e6a834] [tip]
2902
2906
2903 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2907 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2904 1 files changed, 300 insertions(+), 0 deletions(-)
2908 1 files changed, 300 insertions(+), 0 deletions(-)
2905
2909
2906 $ hg log -l1 -r a98683e6a834 --stat -G -T compact
2910 $ hg log -l1 -r a98683e6a834 --stat -G -T compact
2907 @ 1[tip] a98683e6a834 1970-01-01 00:00 +0000 test
2911 @ 1[tip] a98683e6a834 1970-01-01 00:00 +0000 test
2908 | modify a
2912 | modify a
2909 ~
2913 ~
2910 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2914 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2911 1 files changed, 300 insertions(+), 0 deletions(-)
2915 1 files changed, 300 insertions(+), 0 deletions(-)
2912
2916
2913 $ hg log -l1 -r a98683e6a834 --stat -G -T default
2917 $ hg log -l1 -r a98683e6a834 --stat -G -T default
2914 @ changeset: 1:a98683e6a834
2918 @ changeset: 1:a98683e6a834
2915 | tag: tip
2919 | tag: tip
2916 ~ user: test
2920 ~ user: test
2917 date: Thu Jan 01 00:00:00 1970 +0000
2921 date: Thu Jan 01 00:00:00 1970 +0000
2918 summary: modify a
2922 summary: modify a
2919
2923
2920 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2924 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2921 1 files changed, 300 insertions(+), 0 deletions(-)
2925 1 files changed, 300 insertions(+), 0 deletions(-)
2922
2926
2923 $ hg log -l1 -r a98683e6a834 --stat -G -T phases
2927 $ hg log -l1 -r a98683e6a834 --stat -G -T phases
2924 @ changeset: 1:a98683e6a834
2928 @ changeset: 1:a98683e6a834
2925 | tag: tip
2929 | tag: tip
2926 ~ phase: draft
2930 ~ phase: draft
2927 user: test
2931 user: test
2928 date: Thu Jan 01 00:00:00 1970 +0000
2932 date: Thu Jan 01 00:00:00 1970 +0000
2929 summary: modify a
2933 summary: modify a
2930
2934
2931 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2935 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2932 1 files changed, 300 insertions(+), 0 deletions(-)
2936 1 files changed, 300 insertions(+), 0 deletions(-)
2933
2937
2934 $ hg log -l1 -r a98683e6a834 --stat -G -T show
2938 $ hg log -l1 -r a98683e6a834 --stat -G -T show
2935 @ changeset: 1:a98683e6a834
2939 @ changeset: 1:a98683e6a834
2936 | tag: tip
2940 | tag: tip
2937 ~ user: test
2941 ~ user: test
2938 date: Thu Jan 01 00:00:00 1970 +0000
2942 date: Thu Jan 01 00:00:00 1970 +0000
2939 summary: modify a
2943 summary: modify a
2940
2944
2941 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2945 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2942 1 files changed, 300 insertions(+), 0 deletions(-)
2946 1 files changed, 300 insertions(+), 0 deletions(-)
2943
2947
2944 $ hg log -l1 -r a98683e6a834 --stat -G -T status
2948 $ hg log -l1 -r a98683e6a834 --stat -G -T status
2945 @ changeset: 1:a98683e6a834
2949 @ changeset: 1:a98683e6a834
2946 | tag: tip
2950 | tag: tip
2947 ~ user: test
2951 ~ user: test
2948 date: Thu Jan 01 00:00:00 1970 +0000
2952 date: Thu Jan 01 00:00:00 1970 +0000
2949 summary: modify a
2953 summary: modify a
2950 files:
2954 files:
2951 M a
2955 M a
2952
2956
2953 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2957 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2954 1 files changed, 300 insertions(+), 0 deletions(-)
2958 1 files changed, 300 insertions(+), 0 deletions(-)
2955
2959
2956 $ hg log -l1 -r a98683e6a834 --stat -G -T xml
2960 $ hg log -l1 -r a98683e6a834 --stat -G -T xml
2957 <?xml version="1.0"?>
2961 <?xml version="1.0"?>
2958 <log>
2962 <log>
2959 @ <logentry revision="1" node="a98683e6a8340830a7683909768b62871e84bc9d">
2963 @ <logentry revision="1" node="a98683e6a8340830a7683909768b62871e84bc9d">
2960 | <tag>tip</tag>
2964 | <tag>tip</tag>
2961 ~ <author email="test">test</author>
2965 ~ <author email="test">test</author>
2962 <date>1970-01-01T00:00:00+00:00</date>
2966 <date>1970-01-01T00:00:00+00:00</date>
2963 <msg xml:space="preserve">modify a</msg>
2967 <msg xml:space="preserve">modify a</msg>
2964 </logentry>
2968 </logentry>
2965 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2969 a | 300 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2966 1 files changed, 300 insertions(+), 0 deletions(-)
2970 1 files changed, 300 insertions(+), 0 deletions(-)
2967
2971
2968 </log>
2972 </log>
2969
2973
2970 $ cd ..
2974 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now