[DEBUG] remove dead code

This commit is contained in:
Edouard DUPIN 2019-06-12 15:57:09 +02:00
parent 180f2968e7
commit ff9ed410ad

View File

@ -184,72 +184,4 @@ def execute(arguments):
commands.add_file(git_repo_path, version_path_file)
commands.commit_all(git_repo_path, default_update_message)
commands.checkout(git_repo_path, "master")
continue
is_modify = commands.check_repository_is_modify(git_repo_path)
list_branch = commands.get_list_branch_all(git_repo_path)
select_branch = commands.get_current_branch(git_repo_path)
debug.verbose("List all branch: " + str(list_branch))
# get tracking branch
tracking_remote_branch = get_tracking_branch(git_repo_path, argument_remote_name, select_branch)
if tracking_remote_branch == None:
debug.info("" + base_display + "\r\t\t\t\t\t\t\t (NO BRANCH)")
continue
modify_status = " "
if is_modify == True:
modify_status = " *** "
debug.verbose("select branch = '" + select_branch + "' is modify : " + str(is_modify) + " track: '" + str(ret_track[1]) + "'")
cmd = "git rev-list " + select_branch
debug.verbose("execute : " + cmd)
ret_current_branch_sha1 = multiprocess.run_command(cmd, cwd=git_repo_path)[1].split('\n')
cmd = "git rev-list " + ret_track[1]
debug.verbose("execute : " + cmd)
ret_track_branch_sha1 = multiprocess.run_command(cmd, cwd=git_repo_path)[1].split('\n')
# remove all identical sha1 ==> not needed for this
in_forward = 0
for elem_sha1 in ret_current_branch_sha1:
if elem_sha1 not in ret_track_branch_sha1:
in_forward += 1
in_behind = 0
for elem_sha1 in ret_track_branch_sha1:
if elem_sha1 not in ret_current_branch_sha1:
in_behind += 1
behind_forward_comment = ""
if in_forward != 0:
behind_forward_comment += "forward=" + str(in_forward)
if in_behind != 0:
if in_forward != 0:
behind_forward_comment += " "
behind_forward_comment += "behind=" + str(in_behind)
if behind_forward_comment != "":
behind_forward_comment = "\r\t\t\t\t\t\t\t\t\t\t\t\t[" + behind_forward_comment + "]"
tags_comment = ""
# check the current tags of the repository
if argument_display_tag == True:
cmd = "git tag --points-at"
debug.verbose("execute : " + cmd)
ret_current_tags = multiprocess.run_command(cmd, cwd=git_repo_path)[1].split('\n')
debug.verbose("tags found: " + str(ret_current_tags))
for elem_tag in ret_current_tags:
if len(tags_comment) != 0:
tags_comment += ","
tags_comment += elem_tag
if len(tags_comment) != 0:
tags_comment = "\r\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t[" + tags_comment + "]"
#debug.info("" + base_display + "\r\t\t\t\t\t\t\t" + modify_status + "(" + select_branch + " -> " + ret_track[1] + " -> " + elem.select_remote["name"] + "/" + elem.branch + ")")
debug.info("" + base_display + "\r\t\t\t\t\t\t\t" + modify_status + "(" + select_branch + " -> " + ret_track[1] + ")" + behind_forward_comment + tags_comment)
if is_modify == True:
cmd = "git status --short"
debug.verbose("execute : " + cmd)
ret_diff = multiprocess.run_command(cmd, cwd=git_repo_path)
tmp_color_red = "\033[31m"
tmp_color_default= "\033[00m"
debug.info(tmp_color_red + ret_diff[1] + tmp_color_default)