1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 21:28:42 +02:00

Backup edited messages and notify user about them when osc errors out

The messages are kept in ~/.cache/osc/edited-messages for 1 day.
This commit is contained in:
2023-05-04 10:58:21 +02:00
parent 3f9b9a2fb8
commit b789cdfed6
2 changed files with 39 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ import urllib3.exceptions
from . import _private
from . import commandline
from . import conf as osc_conf
from . import core as osc_core
from . import oscerr
from .OscConfigParser import configparser
from .oscssl import CertVerificationError
@@ -196,6 +197,11 @@ def run(prg, argv=None):
print(e, file=sys.stderr)
except oscerr.OscBaseError as e:
print('*** Error:', e, file=sys.stderr)
if osc_core.MESSAGE_BACKUPS:
print()
print("If you lost any edited commit messages due to an error, you may find them here:")
for path in osc_core.MESSAGE_BACKUPS:
print(f" - {path}")
return 1