@@ -313,6 +313,7 @@ def getG2VersionInfo():
313
313
delta = now - commit .committed_datetime
314
314
age = delta .total_seconds ()/ (60 * 60 * 24. )
315
315
msg = ''
316
+ rc = None
316
317
if g2repo .head .is_detached :
317
318
msg = ("\n " +
318
319
"**** You have reverted to a past version of GSAS-II. Please \n "
@@ -322,10 +323,10 @@ def getG2VersionInfo():
322
323
else :
323
324
msg = ''
324
325
rc ,lc ,_ = gitCheckForUpdates (False ,g2repo )
325
- if rc is None :
326
- msg += f" \n \t No history found. On development branch? ( { g2repo .active_branch } )"
327
- elif str ( g2repo . active_branch ) != 'main' :
328
- msg += f' \n \t Using development branch: { g2repo .active_branch } '
326
+ if str ( g2repo . active_branch ) != 'main' :
327
+ msg += f' \n \t Using development branch: " { g2repo .active_branch } "'
328
+ elif rc is None :
329
+ msg += f" \n \t No history found. On a development branch? ( { g2repo .active_branch } )"
329
330
elif age > 60 and len (rc ) > 0 :
330
331
msg += f"\n \t **** This version is really old ({ age :.1f} days). Please update.\n \t **** At least { len (rc )} updates have been posted ****"
331
332
elif (age > 5 and len (rc ) > 0 ) or len (rc ) > 5 :
@@ -334,7 +335,9 @@ def getG2VersionInfo():
334
335
# msg += f"\n\tThis GSAS-II version is ~{len(rc)} updates behind current."
335
336
# could consider getting version & tag from gv if not None (see below)
336
337
gversion = f"{ GetVersionNumber ()} /{ GetVersionTag ()} "
337
- if len (rc ) > 0 :
338
+ if rc is None :
339
+ return f" GSAS-II: { gversion } posted { ctim } (updates unknown) [{ commit .hexsha [:8 ]} ]{ msg } "
340
+ elif len (rc ) > 0 :
338
341
return f" GSAS-II: { gversion } posted { ctim } (\u2265 { len (rc )} new updates) [{ commit .hexsha [:8 ]} ]{ msg } "
339
342
else :
340
343
return f" GSAS-II: { gversion } posted { ctim } (no new updates) [{ commit .hexsha [:8 ]} ]{ msg } "
0 commit comments