Lines Matching refs:os
60 import os, pwd, shutil, tarfile, time, traceback
156 if os.path.exists(bfile):
177 if os.path.exists(self.bu.backupfile('nodes')):
203 if os.path.exists(self.bu.backupfile(fname)):
204 os.unlink(self.bu.backupfile(fname))
308 if not os.path.exists(diff):
351 if not os.path.exists(self.bu.backupfile('renames')):
380 if os.path.exists(diff):
401 if os.path.exists(self.bu.backupfile('renames')):
421 if os.path.exists(self.bu.backupfile(fname)):
422 os.unlink(self.bu.backupfile(fname))
450 if os.path.exists(fpath):
477 if os.path.exists(bfile):
487 if os.path.exists(self.bu.backupfile('metadata.tar.gz')):
519 if os.path.exists(self.bu.backupfile('hgrc')):
527 if os.path.exists(self.bu.backupfile('metadata.tar.gz')):
538 if not os.path.exists(fpath):
550 if (elt.mtime != int(os.path.getmtime(fpath)) or
551 elt.size != os.path.getsize(fpath)):
562 if os.path.isdir(fpath):
570 for root, dirs, files in os.walk(fpath, topdown=True):
572 path = os.path.join(root, elt)
582 if os.path.exists(fpath) and mfile not in tarnames:
589 if os.path.exists(self.bu.backupfile('metadata.tar.gz')):
590 os.unlink(self.bu.backupfile('metadata.tar.gz'))
617 if os.path.exists(os.path.join(self.backupdir, 'latest')):
618 generation = os.readlink(os.path.join(self.backupdir, 'latest'))
619 self.generation = int(os.path.split(generation)[1])
628 if os.path.isabs(name):
632 backupbase = os.path.expanduser(self.ui.config('cdm', 'backupdir'))
637 home = os.getenv('HOME') or pwd.getpwuid(os.getuid()).pw_dir
645 backupbase = os.path.join(home, 'cdm.backup')
647 backupdir = os.path.join(backupbase, name)
650 if (os.path.exists(backupdir) and not os.path.isdir(backupdir)):
657 return os.path.join(self.backupdir, str(self.generation), path)
661 linkpath = os.path.join(self.backupdir, 'latest')
663 if os.path.lexists(linkpath):
664 os.unlink(linkpath)
666 os.symlink(str(gen), linkpath)
671 os.makedirs(os.path.join(self.backupdir, str(gen)))
675 (os.path.join(self.backupdir, str(gen)), e))
685 not os.path.exists(self.backupfile('dirstate'))):
700 if not os.path.exists(self.backupdir):
702 os.makedirs(self.backupdir)
736 os.rmdir(os.path.join(self.backupdir, str(self.generation)))
742 os.unlink(os.path.join(self.backupdir, 'latest'))
755 if not os.path.exists(self.backupdir):
760 if not os.path.exists(os.path.join(self.backupdir, str(gen))):
762 (os.path.join(self.backupdir, str(gen))))
768 if not os.path.exists(self.backupfile('dirstate')):