# HG changeset patch # User Daniel Atallah # Date 1301082583 14400 # 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 -r 46c3043253fb -r c13bfa451656 hgext/convert/monotone.py --- a/hgext/convert/monotone.py Sun Mar 27 13:34:20 2011 +0200 +++ b/hgext/convert/monotone.py Fri Mar 25 15:49:43 2011 -0400 @@ -291,14 +291,18 @@ 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 -r 46c3043253fb -r c13bfa451656 tests/test-convert-mtn.t --- a/tests/test-convert-mtn.t Sun Mar 27 13:34:20 2011 +0200 +++ b/tests/test-convert-mtn.t Fri Mar 25 15:49:43 2011 -0400 @@ -207,6 +207,10 @@ $ 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 @@ dir8-2/a dir9-2/b e + +check branch closing + + $ hg branches -a + $ hg branches -c + com.selenic.test 13:* (closed) (glob) +