changeset 175:a884f134906e

Use "repo.wjoin(...)" instead of "os.path.join(repo.root, ...)". Mercurial docu says that it should allow the handling of some exotic encodings better.
author Franz Glasner <hg@dom66.de>
date Sat, 01 Sep 2018 12:39:42 +0200
parents 4d8f4b5a73c5
children 45af42cb97b7
files extensions/timestamps.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/timestamps.py	Sat Sep 01 12:20:01 2018 +0200
+++ b/extensions/timestamps.py	Sat Sep 01 12:39:42 2018 +0200
@@ -136,14 +136,13 @@
     if not repo.local():
         raise error.Abort(_("repository is not local"))
     matcher = gen_matcher(repo, ctx, tsconfig=tsconfig)
-    with util.posixfile(
-            os.path.join(repo.root, TIMESTAMPS_DATABASE), "wb") as db:
+    with util.posixfile(repo.wjoin(TIMESTAMPS_DATABASE), "wb") as db:
         with FloatTimesInStat():
             db.write("/version/ 1\n")
             db.write("/encoding/ binary\n")
             for fn in ctx:
                 if matcher(fn):
-                    st = os.lstat(os.path.join(repo.root, fn))
+                    st = os.lstat(repo.wjoin(fn))
                     print (fn, st, st.st_mtime, to_isoformat(st.st_mtime))
                     db.write("%s %s\n" % (escape_str_field(fn),
                                           to_isoformat(st.st_mtime)))
@@ -154,7 +153,7 @@
         raise error.Abort(_("repository is not local"))
     cmdutil.bailifchanged(repo)
     matcher = gen_matcher(repo, ctx, tsconfig=tsconfig)
-    print list(read_posix_db(os.path.join(repo.root, TIMESTAMPS_DATABASE)))
+    print list(read_posix_db(repo.wjoin(TIMESTAMPS_DATABASE)))
 
 
 def gen_matcher(repo, ctx, tsconfig=None):