def setUpRepos(cls): cls.repo = anyvcs.create(cls.main_path, 'svn') common.check_call(['svn', 'checkout', 'file://' + cls.main_path, cls.working_path]) cls.main_branch = 'HEAD' cls.working_head = 'HEAD' for action in cls.setUpWorkingCopy(cls.working_path): action.doSvn(cls)
def setUpRepos(cls): cls.repo = anyvcs.create(cls.main_path, 'svn') common.check_call( ['svn', 'checkout', 'file://' + cls.main_path, cls.working_path]) cls.main_branch = 'HEAD' cls.working_head = 'HEAD' for action in cls.setUpWorkingCopy(cls.working_path): action.doSvn(cls)
def setUpRepos(cls): cls.repo = anyvcs.create(cls.main_path, 'git') common.check_call(['git', 'clone', cls.main_path, cls.working_path]) cls.check_call(['git', 'config', 'user.email', '*****@*****.**']) cls.check_call(['git', 'config', 'user.name', 'Test User']) cls.main_branch = 'master' cls.working_head = 'master' for action in cls.setUpWorkingCopy(cls.working_path): action.doGit(cls)
def setUpRepos(cls): cls.repo = anyvcs.create(cls.main_path, 'hg') common.check_call(['hg', 'clone', cls.main_path, cls.working_path]) with open(os.path.join(cls.working_path, '.hg', 'hgrc'), 'a') as hgrc: hgrc.write('[ui]\nusername = Test User <*****@*****.**>\n') cls.main_branch = 'default' cls.working_head = 'default' for action in cls.setUpWorkingCopy(cls.working_path): action.doHg(cls)
def post_save(self, created, **kwargs): if created: makedirs(self.abspath) self._repo = anyvcs.create(self.abspath, self.vcs) self.recalculate_disk_size() elif self._old_path != self.path: makedirs(os.path.dirname(self.abspath)) old_abspath = os.path.join(settings.VCSREPO_ROOT, self._old_path) shutil.move(old_abspath, self.abspath) if not os.path.isabs(self._old_path): removedirs(os.path.dirname(old_abspath), settings.VCSREPO_ROOT) self._old_path = self.path if self.vcs == 'svn': self.update_svnserve() if created: # To save the disk size to the database. self.save()