Skip to content

Commit eb224e6

Browse files
committed
Add stash to update in debug; Put correct version info back
1 parent abaac4e commit eb224e6

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

GSASII/GSASIIctrlGUI.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9486,7 +9486,7 @@ def gitCheckUpdates(G2frame):
94869486
else:
94879487
msg = ('You have made a local branch and have switched to that.'+
94889488
' Do you want to update anyway? Doing so will return'+
9489-
' you to the master branch. This may be better handled'+
9489+
' you to the main branch. This may be better handled'+
94909490
' manually.\n\nPress "Yes" to continue with update\n'+
94919491
'Press "Cancel" to stop the update.')
94929492
dlg = wx.MessageDialog(G2frame, msg, 'Confirm update?',
@@ -9505,7 +9505,7 @@ def gitCheckUpdates(G2frame):
95059505
"changes locally. Your local commits will be difficult "+
95069506
"to locate if you update. SUGGESTION: if your changes "+
95079507
"are meaningful, create a new git branch and return "+
9508-
"to the master branch.\n\n"+
9508+
"to the main branch.\n\n"+
95099509
'Press "Yes" to continue, stranding your local changes\n'+
95109510
'Press "Cancel" to stop the update.')
95119511
dlg = wx.MessageDialog(G2frame, msg, 'Confirm update?',
@@ -9524,13 +9524,31 @@ def gitCheckUpdates(G2frame):
95249524
return
95259525
if len(lc) != 0:
95269526
msg = ('You have made local changes and committed them '+
9527-
'into the master branch. GUI-based updates cannot '+
9527+
'into the main branch. GUI-based updates cannot '+
95289528
'be made. You should perform a git merge manually')
95299529
G2MessageBox(G2frame,msg,title='Do manual update')
95309530
return
95319531

95329532
cmds = ['--git-update']
9533-
if localChanges:
9533+
if localChanges and GSASIIpath.GetConfigValue('debug'):
9534+
msg = ('You have locally-made changes to the GSAS-II source '+
9535+
'code files. Do you want to stash them before updating?\n\n'+
9536+
'If you select "Yes" the update will be applied after '+
9537+
'using git stash. You will need to use "git stash pop" '+
9538+
'to get these changes back.'+
9539+
'\n\nIf you select "No" no update will '+
9540+
'be performed.')
9541+
dlg = wx.MessageDialog(G2frame, msg, 'Stash Local Changes?',
9542+
wx.YES_NO|wx.NO_DEFAULT|wx.CENTRE|wx.ICON_QUESTION)
9543+
ans = dlg.ShowModal()
9544+
dlg.Destroy()
9545+
if ans != wx.ID_YES:
9546+
return
9547+
g2repo = GSASIIpath.openGitRepo(path2GSAS2)
9548+
import datetime as dt
9549+
now = dt.datetime.strftime(dt.datetime.now(),"%Y-%m-%dT%H:%M")
9550+
g2repo.git.stash(f'-m "preserving local changes prior to update from GUI @ {now}"')
9551+
elif localChanges:
95349552
if gitAskLocalChanges(G2frame,cmds): return
95359553
if gitAskSave(G2frame,regressmsg,cmds): return
95369554
# launch changes and restart
@@ -9604,11 +9622,11 @@ def gitSelectVersion(G2frame):
96049622
if localChanges:
96059623
msg = ('You have switched to a local branch and have '+
96069624
'uncommited changes. Save, stash or restore and switch '+
9607-
'back to the master branch. Regression is not possible '+
9625+
'back to the main branch. Regression is not possible '+
96089626
'from the GUI when on any other branch.')
96099627
else:
96109628
msg = ('You have made and switched to a local branch. '+
9611-
'You must manually switch back to the master branch.'+
9629+
'You must manually switch back to the main branch.'+
96129630
' Regression is not possible '+
96139631
'from the GUI when on any other branch.')
96149632
G2MessageBox(G2frame,msg,title='update not possible')
@@ -9624,7 +9642,7 @@ def gitSelectVersion(G2frame):
96249642
"changes locally. Your local commits will be difficult "+
96259643
"to locate if you update. SUGGESTION: if your changes "+
96269644
"are meaningful, create a new git branch and return "+
9627-
"to the master branch.\n\n"+
9645+
"to the main branch.\n\n"+
96289646
'Press "Yes" to continue, stranding your local changes\n'+
96299647
'Press "Cancel" to stop the update.')
96309648
dlg = wx.MessageDialog(G2frame, msg, 'Confirm update?',
@@ -9638,7 +9656,7 @@ def gitSelectVersion(G2frame):
96389656
rc,lc,_ = GSASIIpath.gitCheckForUpdates(False)
96399657
if len(lc) != 0:
96409658
msg = ('You have made local changes and committed them '+
9641-
'into the master branch. GUI-based regression cannot '+
9659+
'into the main branch. GUI-based regression cannot '+
96429660
'be done. You should perform a "git checkout" to the '+
96439661
'desired version manually')
96449662
G2MessageBox(G2frame,msg,title='Do manual update')

GSASII/git_verinfo.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
# git_verinfo.py - GSAS-II version info from git
3-
# Do not edit, generated by 'GSASII/install/incr-version.py' script
4-
# Created 2025-07-11 11:47:43.046289-05:00
3+
# Do not edit, generated by 'install/incr-version.py' script
4+
# Created 2025-08-19 11:46:04.842454-05:00
55

6-
git_version = 'ff0a44f7798ce1024c75f4cbc02e5281ef726a83'
7-
git_tags = ['5817']
8-
git_prevtaggedversion = '0ea8a2dd0eddc87da8f6494f19a5023b41af5daa'
9-
git_prevtags = ['5816']
10-
git_versiontag = 'v5.4.10'
6+
git_version = 'feb99aa4051756a1991c2cfe7bf3609e4f5fb8a7'
7+
git_tags = ['5820']
8+
git_prevtaggedversion = '5cff9c42e599d42707f6051d5e3b8cadc7de7a4c'
9+
git_prevtags = ['5819']
10+
git_versiontag = 'v5.5.2'

0 commit comments

Comments
 (0)