largefiles: remove all uses of os.path.relpath for 2.4 compatibility stable
authorBenjamin Pollack <benjamin@bitquabit.com>
Thu, 20 Oct 2011 17:40:25 -0400
branchstable
changeset 15323 19368c54a774
parent 15322 c8e2a5ea7062
child 15324 0890842c41d1
largefiles: remove all uses of os.path.relpath for 2.4 compatibility
hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Thu Oct 20 16:43:31 2011 +0200
+++ b/hgext/largefiles/overrides.py	Thu Oct 20 17:40:25 2011 -0400
@@ -298,8 +298,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]
@@ -397,12 +396,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':