Closed by commit rHG5ac5c25ea97b: rust-chg: move get_umask() call out of run() 
function (authored by yuja).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs 
Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8402?vs=21037&id=21073

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8402/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8402

AFFECTED FILES
  rust/chg/src/main.rs

CHANGE DETAILS

diff --git a/rust/chg/src/main.rs b/rust/chg/src/main.rs
--- a/rust/chg/src/main.rs
+++ b/rust/chg/src/main.rs
@@ -59,15 +59,15 @@
 
     // TODO: add loop detection by $CHGINTERNALMARK
 
-    let code = run().unwrap_or_else(|err| {
+    let umask = unsafe { procutil::get_umask() }; // not thread safe
+    let code = run(umask).unwrap_or_else(|err| {
         writeln!(io::stderr(), "chg: abort: {}", err).unwrap_or(());
         255
     });
     process::exit(code);
 }
 
-fn run() -> io::Result<i32> {
-    let umask = unsafe { procutil::get_umask() }; // not thread safe
+fn run(umask: u32) -> io::Result<i32> {
     let mut loc = Locator::prepare_from_env()?;
     loc.set_early_args(locator::collect_early_args(env::args_os().skip(1)));
     let handler = ChgUiHandler::new();



To: yuja, #hg-reviewers, Alphare
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to