comparison foodtruck/scm/base.py @ 659:a77b4656c602

internal: Move some basic FoodTruck SCM code to the base.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 27 Feb 2016 22:00:35 -0800
parents 3cec8634209a
children
comparison
equal deleted inserted replaced
658:a920b2ab1f31 659:a77b4656c602
13 13
14 def getStatus(self): 14 def getStatus(self):
15 raise NotImplementedError() 15 raise NotImplementedError()
16 16
17 def commit(self, paths, message, *, author=None): 17 def commit(self, paths, message, *, author=None):
18 if not message:
19 raise ValueError("No message specified for committing changes.")
18 author = author or self.config.get('author') 20 author = author or self.config.get('author')
19 self._doCommit(paths, message, author) 21 self._doCommit(paths, message, author)
20 22
21 def _doCommit(self, paths, message, author): 23 def _doCommit(self, paths, message, author):
22 raise NotImplementedError() 24 raise NotImplementedError()
23 25
26
27 def _s(strs):
28 """ Convert a byte array to string using UTF8 encoding. """
29 if strs is None:
30 return None
31 assert isinstance(strs, bytes)
32 return strs.decode('utf8')
33