Lines Matching refs:self
73 def __init__(self, json):
79 self._json = json
80 self.name = json['name']
81 self.site = json['site']
82 self.subrepo = json['subrepo']
83 self.subdir = json['subdir'] if ('subdir' in json) else '.'
84 self.commit = json['commit']
86 def GetUrl(self):
88 host = SITE_TO_HOST[self.site]
91 subrepo=self.subrepo)
93 def AddRemote(self):
95 remotes = command_output(['git', 'remote'], self.subdir).splitlines()
97 command_output(['git', 'remote', 'add', 'known-good', self.GetUrl()], self.subdir)
99 def HasCommit(self):
102 self.commit + "^{commit}"],
103 cwd=self.subdir)
105 def Clone(self):
106 os.makedirs(self.subdir, exist_ok=True)
107 command_output(['git', 'clone', self.GetUrl(), '.'], self.subdir)
109 def Fetch(self):
110 command_output(['git', 'fetch', 'known-good'], self.subdir)
112 def Checkout(self):
113 if not os.path.exists(os.path.join(self.subdir,'.git')):
114 self.Clone()
115 self.AddRemote()
116 if not self.HasCommit():
117 self.Fetch()
118 command_output(['git', 'checkout', self.commit], self.subdir)