Lines Matching refs:os

74 import grp, os, pwd, shutil, tarfile, time, traceback
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):
177 t.uid = os.getuid()
178 t.gid = os.getgid()
534 files = filter(lambda (name, path): os.path.exists(path),
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)
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])
816 if os.path.isabs(name):
820 backupbase = os.path.expanduser(self.ui.config('cdm', 'backupdir'))
825 home = os.getenv('HOME') or pwd.getpwuid(os.getuid()).pw_dir
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):
848 os.unlink(linkpath)
850 os.symlink(str(gen), linkpath)
855 os.makedirs(os.path.join(self.backupdir, str(gen)))
859 (os.path.join(self.backupdir, str(gen)), e))
863 return os.path.join(self.backupdir, str(self.generation), path)
871 if os.path.exists(fpath):
872 os.unlink(fpath)
881 return os.path.exists(self.backupfile(name))
905 if not os.path.exists(self.backupdir):
907 os.makedirs(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))))