modify log system qith queue, add async command, change status bar function with color
This commit is contained in:
parent
daaf409be9
commit
4245b7447c
@ -2027,6 +2027,61 @@ class GitSvnSyncApp:
|
|||||||
if hasattr(self, "main_frame") and self.main_frame.winfo_exists():
|
if hasattr(self, "main_frame") and self.main_frame.winfo_exists():
|
||||||
self.main_frame.update_status_bar("Error processing async result.", bg_color=self.main_frame.STATUS_RED, duration_ms=10000)
|
self.main_frame.update_status_bar("Error processing async result.", bg_color=self.main_frame.STATUS_RED, duration_ms=10000)
|
||||||
|
|
||||||
|
def _generate_next_tag_suggestion(self, svn_path):
|
||||||
|
"""Generates suggested tag name based on latest v.X.X.X.X tag."""
|
||||||
|
# (Implementazione come discussa precedentemente)
|
||||||
|
log_handler.log_debug("Generating next tag suggestion...")
|
||||||
|
default_suggestion = "v.0.0.0.1"
|
||||||
|
latest_valid_tag = None
|
||||||
|
# Pattern più robusto: permette v. (numeri separati da punti)
|
||||||
|
tag_pattern = re.compile(r"^v\.(\d+)\.(\d+)\.(\d+)\.(\d+)$")
|
||||||
|
|
||||||
|
try:
|
||||||
|
tags_data = self.git_commands.list_tags(svn_path)
|
||||||
|
if not tags_data:
|
||||||
|
log_handler.log_debug("No existing tags found. Suggesting default.")
|
||||||
|
return default_suggestion
|
||||||
|
|
||||||
|
for tag_name, _ in tags_data: # Itera sui tag (dal più recente)
|
||||||
|
match = tag_pattern.match(tag_name)
|
||||||
|
if match:
|
||||||
|
latest_valid_tag = tag_name
|
||||||
|
log_handler.log_debug(f"Found latest tag matching pattern: {latest_valid_tag}")
|
||||||
|
break
|
||||||
|
|
||||||
|
if not latest_valid_tag:
|
||||||
|
log_handler.log_debug("No tags matched the pattern v.X.X.X.X. Suggesting default.")
|
||||||
|
return default_suggestion
|
||||||
|
|
||||||
|
match = tag_pattern.match(latest_valid_tag)
|
||||||
|
if not match:
|
||||||
|
log_handler.log_error(f"Internal error: Could not re-match tag {latest_valid_tag}")
|
||||||
|
return default_suggestion
|
||||||
|
|
||||||
|
# Incrementa i numeri, assumendo formato v1.v2.v3.v4
|
||||||
|
# Qui usiamo la logica con riporto a 99 come richiesto
|
||||||
|
v1, v2, v3, v4 = map(int, match.groups())
|
||||||
|
limit = 99 # Limite per il riporto
|
||||||
|
|
||||||
|
v4 += 1
|
||||||
|
if v4 > limit:
|
||||||
|
v4 = 0
|
||||||
|
v3 += 1
|
||||||
|
if v3 > limit:
|
||||||
|
v3 = 0
|
||||||
|
v2 += 1
|
||||||
|
if v2 > limit:
|
||||||
|
v2 = 0
|
||||||
|
v1 += 1
|
||||||
|
|
||||||
|
next_tag = f"v.{v1}.{v2}.{v3}.{v4}"
|
||||||
|
log_handler.log_debug(f"Generated suggestion: {next_tag}")
|
||||||
|
return next_tag
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
log_handler.log_error(f"Error generating tag suggestion: {e}", exc_info=True)
|
||||||
|
return default_suggestion
|
||||||
|
|
||||||
|
|
||||||
# --- Punto di Ingresso (invariato) ---
|
# --- Punto di Ingresso (invariato) ---
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user