forked from Rust-related/RustPython
Use git_identifier instead of version_number
This commit is contained in:
@@ -166,7 +166,7 @@ fn sys_exc_info(vm: &VirtualMachine) -> PyResult {
|
||||
fn sys_git_info(vm: &VirtualMachine) -> PyObjectRef {
|
||||
vm.ctx.new_tuple(vec![
|
||||
vm.ctx.new_str("RustPython".to_string()),
|
||||
vm.ctx.new_str(version::get_version_number()),
|
||||
vm.ctx.new_str(version::get_git_identifier()),
|
||||
vm.ctx.new_str(version::get_git_revision()),
|
||||
])
|
||||
}
|
||||
|
||||
@@ -47,3 +47,14 @@ pub fn get_git_branch() -> String {
|
||||
.unwrap_or("")
|
||||
.to_string()
|
||||
}
|
||||
|
||||
pub fn get_git_identifier() -> String {
|
||||
let git_tag = get_git_tag();
|
||||
let git_branch = get_git_branch();
|
||||
|
||||
if git_tag.is_empty() || git_tag == "undefined" {
|
||||
git_branch
|
||||
} else {
|
||||
git_tag
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user