comparison hgext/convert/monotone.py @ 13779:c13bfa451656

convert/mtn: convert suspended branches as closed branches Monotone treats branch closing ("suspending") in a similar manner to how we do in mercurial - a cert is added to a revision that marks the branch to be hidden. If a subsequent commit is made, the branch is effectively reopened.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 25 Mar 2011 15:49:43 -0400
parents aeb41f0048e7
children a916e8de4313
comparison
equal deleted inserted replaced
13778:46c3043253fb 13779:c13bfa451656
289 self.mtnloadmanifest(rev) 289 self.mtnloadmanifest(rev)
290 node, attr = self.files.get(name, (None, "")) 290 node, attr = self.files.get(name, (None, ""))
291 return data, attr 291 return data, attr
292 292
293 def getcommit(self, rev): 293 def getcommit(self, rev):
294 certs = self.mtngetcerts(rev) 294 extra = {}
295 certs = self.mtngetcerts(rev)
296 if certs.get('suspend') == certs["branch"]:
297 extra['close'] = '1'
295 return commit( 298 return commit(
296 author=certs["author"], 299 author=certs["author"],
297 date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")), 300 date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")),
298 desc=certs["changelog"], 301 desc=certs["changelog"],
299 rev=rev, 302 rev=rev,
300 parents=self.mtnrun("parents", rev).splitlines(), 303 parents=self.mtnrun("parents", rev).splitlines(),
301 branch=certs["branch"]) 304 branch=certs["branch"],
305 extra=extra)
302 306
303 def gettags(self): 307 def gettags(self):
304 tags = {} 308 tags = {}
305 for e in self.mtnrun("tags").split("\n\n"): 309 for e in self.mtnrun("tags").split("\n\n"):
306 m = self.tag_re.match(e) 310 m = self.tag_re.match(e)