##// END OF EJS Templates
packaging: support building WiX installers with PyOxidizer...
packaging: support building WiX installers with PyOxidizer We initially implemented PyOxidizer support for Inno installers. That did most of the heavy work of integrating PyOxidizer into the packaging system. Implementing WiX installer support was pretty straightforward. Aspects of this patch look very similar to Inno's. The main difference is the handling of the Visual C++ Redistributable Runtime files. The WiX installer was formerly using merge modules to install the VC++ 9.0 runtime because this feature is supported by the WiX installer (it isn't easily available to Inno installers). Our strategy for the runtime files is to install the vcruntime140.dll file next to hg.exe just like any other file. While we could leverage WiX's functionality for invoking a VCRedist installer, I don't want to deal with the complexity at this juncture. So, we let run_pyoxidizer() copy vcruntime140.dll into the staging directory (like it does for Inno) and our dynamic WiX XML generator picks it up as a regular file and installs it. We did, however, have to teach mercurial.wxs how to conditionally use the merge modules. But this was rather straightforward. Comparing the file layout of the WiX installers before and after: * Various lib/*.{pyd, dll} files no longer exist * python27.dll was replaced by python37.dll * vcruntime140.dll was added All these changes are expected due to the transition to Python 3 and to PyOxidizer, which embeded the .pyd and .dll files in hg.exe. Differential Revision: https://phab.mercurial-scm.org/D8477

File last commit:

r44278:5ac243a9 default
r45260:c9517d9d default
Show More
dirstate.rs
81 lines | 2.2 KiB | application/rls-services+xml | RustLexer
Raphaël Gomès
rust-parsers: switch to parse/pack_dirstate to mutate-on-loop...
r42993 // dirstate module
//
// Copyright 2019 Raphaël Gomès <rgomes@octobus.net>
//
// This software may be used and distributed according to the terms of the
// GNU General Public License version 2 or any later version.
Raphaël Gomès
rust-performance: introduce FastHashMap type alias for HashMap...
r44278 use crate::{utils::hg_path::HgPathBuf, DirstateParseError, FastHashMap};
Yuya Nishihara
rust-dirstate: provide CopyMapIter and StateMapIter types...
r43156 use std::collections::hash_map;
Raphaël Gomès
rust-dirstate: use EntryState enum instead of literals...
r42994 use std::convert::TryFrom;
Raphaël Gomès
rust-parsers: switch to parse/pack_dirstate to mutate-on-loop...
r42993
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828 pub mod dirs_multiset;
Raphaël Gomès
rust-dirstate: rust implementation of dirstatemap...
r42998 pub mod dirstate_map;
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828 pub mod parsers;
Raphaël Gomès
rust-dirstate-status: add first Rust implementation of `dirstate.status`...
r43565 pub mod status;
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828
Raphaël Gomès
rust-parsers: switch to parse/pack_dirstate to mutate-on-loop...
r42993 #[derive(Debug, PartialEq, Clone)]
pub struct DirstateParents {
pub p1: [u8; 20],
pub p2: [u8; 20],
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828 }
/// The C implementation uses all signed types. This will be an issue
/// either when 4GB+ source files are commonplace or in 2038, whichever
/// comes first.
Raphaël Gomès
rust-parsers: switch to parse/pack_dirstate to mutate-on-loop...
r42993 #[derive(Debug, PartialEq, Copy, Clone)]
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828 pub struct DirstateEntry {
Raphaël Gomès
rust-dirstate: use EntryState enum instead of literals...
r42994 pub state: EntryState,
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828 pub mode: i32,
pub mtime: i32,
pub size: i32,
}
Raphaël Gomès
rust: introduce SIZE_FROM_OTHER_PARENT constant...
r44003 /// A `DirstateEntry` with a size of `-2` means that it was merged from the
/// other parent. This allows revert to pick the right status back during a
/// merge.
pub const SIZE_FROM_OTHER_PARENT: i32 = -2;
Raphaël Gomès
rust-performance: introduce FastHashMap type alias for HashMap...
r44278 pub type StateMap = FastHashMap<HgPathBuf, DirstateEntry>;
Raphaël Gomès
rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf...
r43227 pub type StateMapIter<'a> = hash_map::Iter<'a, HgPathBuf, DirstateEntry>;
Raphaël Gomès
rust-performance: introduce FastHashMap type alias for HashMap...
r44278 pub type CopyMap = FastHashMap<HgPathBuf, HgPathBuf>;
Raphaël Gomès
rust-hgpath: replace all paths and filenames with HgPath/HgPathBuf...
r43227 pub type CopyMapIter<'a> = hash_map::Iter<'a, HgPathBuf, HgPathBuf>;
Raphaël Gomès
rust: switch hg-core and hg-cpython to rust 2018 edition...
r42828
Raphaël Gomès
rust-dirstate: use EntryState enum instead of literals...
r42994 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum EntryState {
Normal,
Added,
Removed,
Merged,
Unknown,
}
impl TryFrom<u8> for EntryState {
type Error = DirstateParseError;
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
b'n' => Ok(EntryState::Normal),
b'a' => Ok(EntryState::Added),
b'r' => Ok(EntryState::Removed),
b'm' => Ok(EntryState::Merged),
b'?' => Ok(EntryState::Unknown),
_ => Err(DirstateParseError::CorruptedEntry(format!(
"Incorrect entry state {}",
value
))),
}
}
}
impl Into<u8> for EntryState {
fn into(self) -> u8 {
match self {
EntryState::Normal => b'n',
EntryState::Added => b'a',
EntryState::Removed => b'r',
EntryState::Merged => b'm',
EntryState::Unknown => b'?',
}
}
}