comparison buttercup/source.py @ 40:4ea66cb5485d

better error message
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 31 Oct 2011 18:53:46 -0700
parents 052ee8a2ebde
children 693f209fdbaa
comparison
equal deleted inserted replaced
39:920afc079905 40:4ea66cb5485d
36 def update(self): 36 def update(self):
37 """updates a checkout or does one if it does not exist""" 37 """updates a checkout or does one if it does not exist"""
38 if os.path.exists(self.directory()): 38 if os.path.exists(self.directory()):
39 hgdir = os.path.join(self.directory(), '.hg') 39 hgdir = os.path.join(self.directory(), '.hg')
40 assert os.path.exists(hgdir), "Not an hg directory: %s" % hgdir 40 assert os.path.exists(hgdir), "Not an hg directory: %s" % hgdir
41 call(['hg', 'pull'], cwd=self.directory()) 41 try:
42 call(['hg', 'update'], cwd=self.directory()) 42 call(['hg', 'pull'], cwd=self.directory())
43 call(['hg', 'update'], cwd=self.directory())
44 except:
45 print 'Directory: %s' % self.directory()
46 raise
43 else: 47 else:
44 if not os.path.exists(self.srcdir): 48 if not os.path.exists(self.srcdir):
45 os.makedirs(self.srcdir) 49 os.makedirs(self.srcdir)
46 call(['hg', 'clone', self.uri], cwd=self.srcdir) 50 call(['hg', 'clone', self.uri], cwd=self.srcdir)
47 # TODO: add a more intelligent .hg/hgrc 51 # TODO: add a more intelligent .hg/hgrc