# HG changeset patch # User Daniel Atallah # Date 2011-03-25 19:49:43 # Node ID c13bfa451656f5fd9d677f7524d3693c83aa86fc # Parent 46c3043253fbd4f54bed61c4cdda2a2c198e622f 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. diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py --- a/hgext/convert/monotone.py +++ b/hgext/convert/monotone.py @@ -291,14 +291,18 @@ class monotone_source(converter_source, return data, attr def getcommit(self, rev): - certs = self.mtngetcerts(rev) + extra = {} + certs = self.mtngetcerts(rev) + if certs.get('suspend') == certs["branch"]: + extra['close'] = '1' return commit( author=certs["author"], date=util.datestr(util.strdate(certs["date"], "%Y-%m-%dT%H:%M:%S")), desc=certs["changelog"], rev=rev, parents=self.mtnrun("parents", rev).splitlines(), - branch=certs["branch"]) + branch=certs["branch"], + extra=extra) def gettags(self): tags = {} diff --git a/tests/test-convert-mtn.t b/tests/test-convert-mtn.t --- a/tests/test-convert-mtn.t +++ b/tests/test-convert-mtn.t @@ -207,6 +207,10 @@ test diverging directory moves $ mtn ci -m divergentdirmove2 mtn: beginning commit on branch 'com.selenic.test' mtn: committed revision 4a736634505795f17786fffdf2c9cbf5b11df6f6 + +test suspending (closing a branch) + + $ mtn suspend 4a736634505795f17786fffdf2c9cbf5b11df6f6 2> /dev/null $ cd .. convert incrementally @@ -355,3 +359,10 @@ check divergent directory moves dir8-2/a dir9-2/b e + +check branch closing + + $ hg branches -a + $ hg branches -c + com.selenic.test 13:* (closed) (glob) +