diff mercurial/hg.py @ 634:da5378d39269

Add a repo method to report repo device This is used to establish whether repos are on the same device for hard linking. Remote repos all return -1.
author Matt Mackall <mpm@selenic.com>
date Wed, 06 Jul 2005 22:14:10 -0800
parents b6c42714d900
children 85e2209d401c
line wrap: on
line diff
--- a/mercurial/hg.py	Wed Jul 06 22:11:54 2005 -0800
+++ b/mercurial/hg.py	Wed Jul 06 22:14:10 2005 -0800
@@ -498,6 +498,10 @@
         except KeyError:
             return self.changelog.lookup(key)
 
+    def dev(self):
+        if self.remote: return -1
+        return os.stat(self.path).st_dev
+
     def join(self, f):
         return os.path.join(self.path, f)
 
@@ -1547,6 +1551,9 @@
         opener = urllib2.build_opener(proxy_handler, authinfo)
         urllib2.install_opener(opener)
 
+    def dev(self):
+        return -1
+
     def do_cmd(self, cmd, **args):
         self.ui.debug("sending %s command\n" % cmd)
         q = {"cmd": cmd}
@@ -1624,6 +1631,9 @@
         self.pipeo.close()
         self.pipei.close()
 
+    def dev(self):
+        return -1
+
     def do_cmd(self, cmd, **args):
         self.ui.debug("sending %s command\n" % cmd)
         self.pipeo.write("%s\n" % cmd)