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
|
extends: .recompile-branch
|
||||||
stage: build
|
stage: build
|
||||||
variables:
|
variables:
|
||||||
GIT_DEPTH: 0
|
GIT_DEPTH: 9999999999999
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
script:
|
script:
|
||||||
- ln -s /dockercache/cache-all target
|
- ln -s /dockercache/cache-all target
|
||||||
@ -110,4 +110,4 @@ opt-windows:
|
|||||||
opt-macos:
|
opt-macos:
|
||||||
extends:
|
extends:
|
||||||
- .tmacos
|
- .tmacos
|
||||||
- .optional-release
|
- .optional-release
|
||||||
|
@ -108,7 +108,10 @@ fn generate_key_version<'a>(
|
|||||||
.iter()
|
.iter()
|
||||||
.for_each(|e: git2::BlameHunk| {
|
.for_each(|e: git2::BlameHunk| {
|
||||||
for state in keys.values_mut() {
|
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() {
|
if line >= e.final_start_line() && line < e.final_start_line() + e.lines_in_hunk() {
|
||||||
state.chuck_line_range = Some((
|
state.chuck_line_range = Some((
|
||||||
@ -176,14 +179,25 @@ fn test_all_localizations<'a>() {
|
|||||||
|
|
||||||
// Find the localization entry state
|
// Find the localization entry state
|
||||||
let current_blob = read_file_from_path(&repo, &head_ref, &relfile);
|
let current_blob = read_file_from_path(&repo, &head_ref, &relfile);
|
||||||
let current_loc: VoxygenLocalization =
|
let current_loc: VoxygenLocalization = match from_bytes(current_blob.content()) {
|
||||||
from_bytes(current_blob.content()).expect("Expect to parse the RON file");
|
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);
|
let mut current_i18n = generate_key_version(&repo, ¤t_loc, &relfile, ¤t_blob);
|
||||||
for (ref_key, ref_state) in i18n_references.iter() {
|
for (ref_key, ref_state) in i18n_references.iter() {
|
||||||
match current_i18n.get_mut(ref_key) {
|
match current_i18n.get_mut(ref_key) {
|
||||||
Some(state) => {
|
Some(state) => {
|
||||||
let commit_id = state.commit_id.unwrap();
|
let commit_id = match state.commit_id {
|
||||||
let ref_commit_id = ref_state.commit_id.unwrap();
|
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
|
if commit_id != ref_commit_id
|
||||||
&& !repo
|
&& !repo
|
||||||
.graph_descendant_of(commit_id, ref_commit_id)
|
.graph_descendant_of(commit_id, ref_commit_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user