fix in updater

This commit is contained in:
Mario Voigt 2024-01-25 16:57:49 +01:00
parent a7776e7595
commit 9429706fb6
2 changed files with 13 additions and 12 deletions

View File

@ -10,7 +10,7 @@
<param name="convert_to_git" type="bool" gui-text="Convert to .git" gui-description="If you downloaded MightyScape as .zip or .tar.gz you cannot upgrade using this extension. But you can convert your downloaded directory to a .git one by enabling this option">false</param>
<param name="recreate_remotes" type="bool" gui-text="Recreate remotes" gui-description="Update remotes in git config file (useful if you have an older version of MightyScape or if something changes). Warning: might drop passwords/auth tokens!">false</param>
<param name="stash_untracked" type="bool" gui-text="Stash untracked files" gui-description="Enable to drop your local changes">false</param>
<param name="stash_untracked" type="bool" gui-text="Stash untracked files/back to origin" gui-description="Enable to drop your local changes. If HEAD is not attached or unchaged files block a git pull.">false</param>
<label>Click "Apply" to upgrade MightyScape to recent version!</label>
<spacer />
<label appearance="header">Hint: Zip File Mirror</label>

View File

@ -72,7 +72,7 @@ class AboutUpgradeMightyScape(inkex.EffectExtension):
inkex.utils.debug("Nothing to do! MightyScape is already up to date!")
except git.exc.GitCommandError as e:
if "Your local changes to the following files would be overwritten by merge" in e:
if "Your local changes to the following files would be overwritten by merge" in str(e):
inkex.utils.debug("Please save or stash your local git changes first and try again. You can enable 'Stash untracked files' to continue.")
else:
inkex.utils.debug("Error: ")
@ -142,6 +142,7 @@ class AboutUpgradeMightyScape(inkex.EffectExtension):
#drop local changed. update might fail if file changes are present
if so.stash_untracked is True:
local_repo.git.stash('save')
local_repo.git.checkout('origin/master')
existingRemotes = [] #check for existing remotes. if one is missing, add it (or delete and recreate)
for r in local_repo.remotes: