@@ -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 \n Press "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 \n If 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' )
0 commit comments