changeset 926:b765e970c9ff

Add a local() method to repository classes
author mpm@selenic.com
date Tue, 16 Aug 2005 19:17:01 -0800
parents 5a034646e472
children 5a830d7bea52
files mercurial/hg.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Tue Aug 16 19:03:01 2005 -0800
+++ b/mercurial/hg.py	Tue Aug 16 19:17:01 2005 -0800
@@ -749,6 +749,9 @@
         if self.remote: return -1
         return os.stat(self.path).st_dev
 
+    def local(self):
+        return not self.remote
+
     def join(self, f):
         return os.path.join(self.path, f)
 
@@ -1939,7 +1942,11 @@
             self.ui.warn("%d integrity errors encountered!\n" % errors)
             return 1
 
-class httprepository:
+class remoterepository:
+    def local(self):
+        return False
+
+class httprepository(remoterepository):
     def __init__(self, ui, path):
         # fix missing / after hostname
         s = urlparse.urlsplit(path)
@@ -2078,7 +2085,7 @@
         if self.repo:
             self.release()
 
-class sshrepository:
+class sshrepository(remoterepository):
     def __init__(self, ui, path):
         self.url = path
         self.ui = ui