mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix localization test
This commit is contained in:
parent
930e0028bc
commit
72ec565678
@ -21,7 +21,7 @@ localization-status:
|
||||
extends: .recompile-branch
|
||||
stage: build
|
||||
variables:
|
||||
GIT_DEPTH: 0
|
||||
GIT_DEPTH: 9999999999999
|
||||
allow_failure: true
|
||||
script:
|
||||
- ln -s /dockercache/cache-all target
|
||||
|
@ -108,7 +108,10 @@ fn generate_key_version<'a>(
|
||||
.iter()
|
||||
.for_each(|e: git2::BlameHunk| {
|
||||
for state in keys.values_mut() {
|
||||
let line = state.key_line.unwrap();
|
||||
let line = match state.key_line {
|
||||
Some(l) => l,
|
||||
None => continue,
|
||||
};
|
||||
|
||||
if line >= e.final_start_line() && line < e.final_start_line() + e.lines_in_hunk() {
|
||||
state.chuck_line_range = Some((
|
||||
@ -176,14 +179,25 @@ fn test_all_localizations<'a>() {
|
||||
|
||||
// Find the localization entry state
|
||||
let current_blob = read_file_from_path(&repo, &head_ref, &relfile);
|
||||
let current_loc: VoxygenLocalization =
|
||||
from_bytes(current_blob.content()).expect("Expect to parse the RON file");
|
||||
let current_loc: VoxygenLocalization = match from_bytes(current_blob.content()) {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
eprintln!("Could not parse RON file, skipping: {}", e);
|
||||
continue;
|
||||
},
|
||||
};
|
||||
let mut current_i18n = generate_key_version(&repo, ¤t_loc, &relfile, ¤t_blob);
|
||||
for (ref_key, ref_state) in i18n_references.iter() {
|
||||
match current_i18n.get_mut(ref_key) {
|
||||
Some(state) => {
|
||||
let commit_id = state.commit_id.unwrap();
|
||||
let ref_commit_id = ref_state.commit_id.unwrap();
|
||||
let commit_id = match state.commit_id {
|
||||
Some(c) => c,
|
||||
None => continue,
|
||||
};
|
||||
let ref_commit_id = match ref_state.commit_id {
|
||||
Some(c) => c,
|
||||
None => continue,
|
||||
};
|
||||
if commit_id != ref_commit_id
|
||||
&& !repo
|
||||
.graph_descendant_of(commit_id, ref_commit_id)
|
||||
|
Loading…
Reference in New Issue
Block a user