[PATCH] largefiles: remove all uses of os.path.relpath for 2.4 compatibility

Benjamin Pollack benjamin at bitquabit.com
Thu Oct 20 16:40:37 CDT 2011


# HG changeset patch
# User Benjamin Pollack <benjamin at bitquabit.com>
# Date 1319146825 14400
# Branch stable
# Node ID 2758ea169026237ec494ee284e18a8f8e5f48822
# Parent  b48404c8e6cf7d44c324a3d4d808b316b5fc6736
largefiles: remove all uses of os.path.relpath for 2.4 compatibility

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -297,8 +297,7 @@
 
     def makestandin(relpath):
         path = scmutil.canonpath(repo.root, repo.getcwd(), relpath)
-        return os.path.join(os.path.relpath('.', repo.getcwd()),
-            lfutil.standin(path))
+        return os.path.join(repo.wjoin(lfutil.standin(path)))
 
     fullpats = scmutil.expandpats(pats)
     dest = fullpats[-1]
@@ -396,12 +395,10 @@
                         os.makedirs(destlfiledir)
                     if rename:
                         os.rename(srclfile, destlfile)
-                        lfdirstate.remove(os.path.relpath(srclfile,
-                            repo.root))
+                        lfdirstate.remove(repo.wjoin(srclfile))
                     else:
                         util.copyfile(srclfile, destlfile)
-                    lfdirstate.add(os.path.relpath(destlfile,
-                        repo.root))
+                    lfdirstate.add(repo.wjoin(destlfile))
             lfdirstate.write()
         except util.Abort, e:
             if str(e) != 'no files to copy':


More information about the Mercurial-devel mailing list