author | Simon Sapin <simon.sapin@octobus.net> |
Mon, 01 Feb 2021 11:41:10 +0100 | |
changeset 46463 | 95b276283b67 |
parent 46462 | d03b0601e0eb |
child 46614 | a069639783a0 |
permissions | -rw-r--r-- |
46443
43d63979a75e
rust: use HgError in RevlogError and Vfs
Simon Sapin <simon.sapin@octobus.net>
parents:
46442
diff
changeset
|
1 |
use crate::errors::{HgError, HgResultExt}; |
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
2 |
use crate::repo::{Repo, Vfs}; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
3 |
use std::collections::HashSet; |
45924
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
4 |
|
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
5 |
fn parse(bytes: &[u8]) -> Result<HashSet<String>, HgError> { |
45924
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
6 |
// The Python code reading this file uses `str.splitlines` |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
7 |
// which looks for a number of line separators (even including a couple of |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
8 |
// non-ASCII ones), but Python code writing it always uses `\n`. |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
9 |
let lines = bytes.split(|&byte| byte == b'\n'); |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
10 |
|
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
11 |
lines |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
12 |
.filter(|line| !line.is_empty()) |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
13 |
.map(|line| { |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
14 |
// Python uses Unicode `str.isalnum` but feature names are all |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
15 |
// ASCII |
45938
f5d62f4d5327
rhg: check that .hg/requires is ASCII
Simon Sapin <simon-commits@exyr.org>
parents:
45937
diff
changeset
|
16 |
if line[0].is_ascii_alphanumeric() && line.is_ascii() { |
45924
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
17 |
Ok(String::from_utf8(line.into()).unwrap()) |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
18 |
} else { |
46442
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
19 |
Err(HgError::corrupted("parse error in 'requires' file")) |
45924
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
20 |
} |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
21 |
}) |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
22 |
.collect() |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
23 |
} |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
24 |
|
46463
95b276283b67
rhg: add support for share-safe
Simon Sapin <simon.sapin@octobus.net>
parents:
46462
diff
changeset
|
25 |
pub(crate) fn load(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> { |
95b276283b67
rhg: add support for share-safe
Simon Sapin <simon.sapin@octobus.net>
parents:
46462
diff
changeset
|
26 |
parse(&hg_vfs.read("requires")?) |
95b276283b67
rhg: add support for share-safe
Simon Sapin <simon.sapin@octobus.net>
parents:
46462
diff
changeset
|
27 |
} |
95b276283b67
rhg: add support for share-safe
Simon Sapin <simon.sapin@octobus.net>
parents:
46462
diff
changeset
|
28 |
|
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
29 |
pub(crate) fn load_if_exists(hg_vfs: Vfs) -> Result<HashSet<String>, HgError> { |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
30 |
if let Some(bytes) = hg_vfs.read("requires").io_not_found_as_none()? { |
46442
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
31 |
parse(&bytes) |
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
32 |
} else { |
45924
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
33 |
// Treat a missing file the same as an empty file. |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
34 |
// From `mercurial/localrepo.py`: |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
35 |
// > requires file contains a newline-delimited list of |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
36 |
// > features/capabilities the opener (us) must have in order to use |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
37 |
// > the repository. This file was introduced in Mercurial 0.9.2, |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
38 |
// > which means very old repositories may not have one. We assume |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
39 |
// > a missing file translates to no requirements. |
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
40 |
Ok(HashSet::new()) |
45924
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
41 |
} |
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
diff
changeset
|
42 |
} |
45937
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
43 |
|
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
44 |
pub(crate) fn check(repo: &Repo) -> Result<(), HgError> { |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
45 |
for feature in repo.requirements() { |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
46 |
if !SUPPORTED.contains(&feature.as_str()) { |
46442
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
47 |
// TODO: collect and all unknown features and include them in the |
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
48 |
// error message? |
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
49 |
return Err(HgError::UnsupportedFeature(format!( |
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
50 |
"repository requires feature unknown to this Mercurial: {}", |
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
51 |
feature |
02d3bb972121
rust: replace RequirementsError with HgError
Simon Sapin <simon.sapin@octobus.net>
parents:
46167
diff
changeset
|
52 |
))); |
45937
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
53 |
} |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
54 |
} |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
55 |
Ok(()) |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
56 |
} |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
57 |
|
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
58 |
// TODO: set this to actually-supported features |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
59 |
const SUPPORTED: &[&str] = &[ |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
60 |
"dotencode", |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
61 |
"fncache", |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
62 |
"generaldelta", |
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
63 |
"revlogv1", |
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
64 |
SHARED_REQUIREMENT, |
46463
95b276283b67
rhg: add support for share-safe
Simon Sapin <simon.sapin@octobus.net>
parents:
46462
diff
changeset
|
65 |
SHARESAFE_REQUIREMENT, |
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
66 |
SPARSEREVLOG_REQUIREMENT, |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
67 |
RELATIVE_SHARED_REQUIREMENT, |
45937
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
68 |
"store", |
46090
9eb07ab3f2d4
rhg: use persistent nodemap when available
Simon Sapin <simon-commits@exyr.org>
parents:
45956
diff
changeset
|
69 |
// As of this writing everything rhg does is read-only. |
9eb07ab3f2d4
rhg: use persistent nodemap when available
Simon Sapin <simon-commits@exyr.org>
parents:
45956
diff
changeset
|
70 |
// When it starts writing to the repository, it’ll need to either keep the |
9eb07ab3f2d4
rhg: use persistent nodemap when available
Simon Sapin <simon-commits@exyr.org>
parents:
45956
diff
changeset
|
71 |
// persistent nodemap up to date or remove this entry: |
9eb07ab3f2d4
rhg: use persistent nodemap when available
Simon Sapin <simon-commits@exyr.org>
parents:
45956
diff
changeset
|
72 |
"persistent-nodemap", |
45937
2ad2745e0be9
rhg: exit with relevant code for unsupported requirements
Simon Sapin <simon-commits@exyr.org>
parents:
45924
diff
changeset
|
73 |
]; |
46462
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
74 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
75 |
// Copied from mercurial/requirements.py: |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
76 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
77 |
/// When narrowing is finalized and no longer subject to format changes, |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
78 |
/// we should move this to just "narrow" or similar. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
79 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
80 |
pub(crate) const NARROW_REQUIREMENT: &str = "narrowhg-experimental"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
81 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
82 |
/// Enables sparse working directory usage |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
83 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
84 |
pub(crate) const SPARSE_REQUIREMENT: &str = "exp-sparse"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
85 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
86 |
/// Enables the internal phase which is used to hide changesets instead |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
87 |
/// of stripping them |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
88 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
89 |
pub(crate) const INTERNAL_PHASE_REQUIREMENT: &str = "internal-phase"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
90 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
91 |
/// Stores manifest in Tree structure |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
92 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
93 |
pub(crate) const TREEMANIFEST_REQUIREMENT: &str = "treemanifest"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
94 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
95 |
/// Increment the sub-version when the revlog v2 format changes to lock out old |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
96 |
/// clients. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
97 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
98 |
pub(crate) const REVLOGV2_REQUIREMENT: &str = "exp-revlogv2.1"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
99 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
100 |
/// A repository with the sparserevlog feature will have delta chains that |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
101 |
/// can spread over a larger span. Sparse reading cuts these large spans into |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
102 |
/// pieces, so that each piece isn't too big. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
103 |
/// Without the sparserevlog capability, reading from the repository could use |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
104 |
/// huge amounts of memory, because the whole span would be read at once, |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
105 |
/// including all the intermediate revisions that aren't pertinent for the |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
106 |
/// chain. This is why once a repository has enabled sparse-read, it becomes |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
107 |
/// required. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
108 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
109 |
pub(crate) const SPARSEREVLOG_REQUIREMENT: &str = "sparserevlog"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
110 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
111 |
/// A repository with the sidedataflag requirement will allow to store extra |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
112 |
/// information for revision without altering their original hashes. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
113 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
114 |
pub(crate) const SIDEDATA_REQUIREMENT: &str = "exp-sidedata-flag"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
115 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
116 |
/// A repository with the the copies-sidedata-changeset requirement will store |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
117 |
/// copies related information in changeset's sidedata. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
118 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
119 |
pub(crate) const COPIESSDC_REQUIREMENT: &str = "exp-copies-sidedata-changeset"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
120 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
121 |
/// The repository use persistent nodemap for the changelog and the manifest. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
122 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
123 |
pub(crate) const NODEMAP_REQUIREMENT: &str = "persistent-nodemap"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
124 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
125 |
/// Denotes that the current repository is a share |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
126 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
127 |
pub(crate) const SHARED_REQUIREMENT: &str = "shared"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
128 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
129 |
/// Denotes that current repository is a share and the shared source path is |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
130 |
/// relative to the current repository root path |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
131 |
#[allow(unused)] |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
132 |
pub(crate) const RELATIVE_SHARED_REQUIREMENT: &str = "relshared"; |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
133 |
|
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
134 |
/// A repository with share implemented safely. The repository has different |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
135 |
/// store and working copy requirements i.e. both `.hg/requires` and |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
136 |
/// `.hg/store/requires` are present. |
d03b0601e0eb
rhg: initial support for shared repositories
Simon Sapin <simon.sapin@octobus.net>
parents:
46443
diff
changeset
|
137 |
#[allow(unused)] |
46463
95b276283b67
rhg: add support for share-safe
Simon Sapin <simon.sapin@octobus.net>
parents:
46462
diff
changeset
|
138 |
pub(crate) const SHARESAFE_REQUIREMENT: &str = "share-safe"; |