Fix of issue 3007.

svn: r12621
This commit is contained in:
Peter Landgren 2009-06-03 18:39:24 +00:00
parent f8859dd81c
commit 54dba4fc09

View File

@ -1064,15 +1064,17 @@ def find_revisions(name):
def find_locker_name(dirpath): def find_locker_name(dirpath):
""" """
Opens the lock file if it exists, reads the contexts and returns Opens the lock file if it exists, reads the contexts which is "USERNAME"
the contents, which should be like "Locked by USERNAME". and returns the contents, with correct string before "USERNAME",
so the message can be printed with correct locale.
If a file is encountered with errors, we return 'Unknown' If a file is encountered with errors, we return 'Unknown'
This data is displayed in the time column of the manager This data is displayed in the time column of the manager
""" """
try: try:
fname = os.path.join(dirpath, "lock") fname = os.path.join(dirpath, "lock")
ifile = open(fname) ifile = open(fname)
last = ifile.read().strip() username = ifile.read().strip()
last = _("Locked by %s") % username
ifile.close() ifile.close()
except (OSError, IOError): except (OSError, IOError):
last = _("Unknown") last = _("Unknown")