Lines Matching refs:path

133             fpath = os.path.join(rootpath, member.name)
135 if not os.path.exists(fpath):
137 elif ((os.path.isfile(fpath) != member.isfile()) or
138 (os.path.isdir(fpath) != member.isdir()) or
139 (os.path.islink(fpath) != member.issym())):
148 elif member.mtime != int(os.path.getmtime(fpath)):
150 elif not member.isdir() and member.size != os.path.getsize(fpath):
161 def addfilectx(self, filectx, path=None):
164 Use the path specified by the filectx object or, if specified,
174 t = tarfile.TarInfo(path or filectx.path())
192 # the destination path in place of the file content. The
531 # Files is a list of tuples (name, path), where name is as in
532 # self.files, and path is the absolute path.
534 files = filter(lambda (name, path): os.path.exists(path),
547 for name, path in files:
549 tar.add(path, name)
595 tar.extract(elt, path=self.ws.repo.path)
619 '''Yield the repo-relative path to each file we operate on,
623 path = self.ws.repo.join(elt)
625 if not os.path.exists(path):
628 if os.path.isdir(path):
629 for root, dirs, files in os.walk(path, topdown=True):
633 yield os.path.join(root, f)
635 yield path
641 '''Remove a possible trailing path separator from PATHNAME'''
652 if not tar.members_match_fs(self.ws.repo.path):
661 repopath = self.ws.repo.path
665 for path in self._walk():
666 if path.replace(repopath, '', 1) not in tarnames:
751 os.path.join(tpath, fname))
807 if os.path.exists(os.path.join(self.backupdir, 'latest')):
808 generation = os.readlink(os.path.join(self.backupdir, 'latest'))
809 self.generation = int(os.path.split(generation)[1])
814 '''Find the path to an appropriate backup directory based on NAME'''
816 if os.path.isabs(name):
820 backupbase = os.path.expanduser(self.ui.config('cdm', 'backupdir'))
831 'find backup path')
833 backupbase = os.path.join(home, 'cdm.backup')
835 backupdir = os.path.join(backupbase, name)
838 if (os.path.exists(backupdir) and not os.path.isdir(backupdir)):
845 linkpath = os.path.join(self.backupdir, 'latest')
847 if os.path.lexists(linkpath):
855 os.makedirs(os.path.join(self.backupdir, str(gen)))
859 (os.path.join(self.backupdir, str(gen)), e))
861 def backupfile(self, path):
862 '''return full path to backup file FILE at GEN'''
863 return os.path.join(self.backupdir, str(self.generation), path)
866 '''Unlink the specified path from the backup directory.
867 A no-op if the path does not exist.
871 if os.path.exists(fpath):
881 return os.path.exists(self.backupfile(name))
905 if not os.path.exists(self.backupdir):
938 os.rmdir(os.path.join(self.backupdir, str(self.generation)))
944 os.unlink(os.path.join(self.backupdir, 'latest'))
957 if not os.path.exists(self.backupdir):
962 if not os.path.exists(os.path.join(self.backupdir, str(gen))):
964 (os.path.join(self.backupdir, str(gen))))