Skip to content

Commit 64b9a84

Browse files
committed
limit regress to post-2025 May 1
1 parent 9d6852c commit 64b9a84

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

GSASII/GSASIIctrlGUI.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7387,6 +7387,7 @@ def __init__(self,parent=None):
73877387
self.initial_commit_info = self.docCommit(self.initial_commit)
73887388
if parent is None:
73897389
parent = wx.GetApp().GetMainTopWindow()
7390+
self.parent = parent
73907391
wx.Dialog.__init__(self, parent, wx.ID_ANY, 'Select GSAS-II Version',
73917392
style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
73927393
sizer = wx.BoxSizer(wx.VERTICAL)
@@ -7515,9 +7516,18 @@ def docCommit(self,commit):
75157516
75167517
:returns: a multi-line string
75177518
'''
7518-
#import datetime
7519+
import datetime
75197520
fmtdate = lambda c:"{:%d-%b-%Y %H:%M}".format(c.committed_datetime)
75207521
commit = self.g2repo.commit(commit) # converts a hash, if supplied
7522+
# do not allow regression before May 1, 2025 so we don't go back to
7523+
# master branch reorg. Switch was actually ~22 Apr 2025, but leave a
7524+
# bit of room
7525+
if datetime.datetime(2025,5,1, tzinfo=commit.committed_datetime.tzinfo
7526+
) > commit.committed_datetime:
7527+
msg = 'Unable to regress automatically to versions prior to last source reorg. If you do need to use an older GSAS-II version please ask for help on mailing list or GitHub Issues.'
7528+
G2MessageBox(self.parent,msg,'Too old')
7529+
self.spin.SetValue(self.spin.GetValue()+1)
7530+
raise IndexError
75217531
msg = f'git {commit.hexsha[:10]} from {fmtdate(commit)}'
75227532
tags = self.g2repo.git.tag('--points-at',commit).split('\n')
75237533
if tags != ['']:

0 commit comments

Comments
 (0)