[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] Re: renaming branches
From: |
Gerhard Schuck |
Subject: |
Re: [Monotone-devel] Re: renaming branches |
Date: |
Thu, 08 Apr 2004 07:17:14 +0900 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114 |
graydon hoare wrote:
Gerhard Schuck wrote:
simple question: Is it possible to rename (or delete) branches? The
[...]
it's possible, yes. you'd need to reissue new branch certs with the new
names, and delete branch certs with the old names. there's no command to
do this at the moment. it's possible to add one. doing it by hand at the
moment would be a bit of a pain, unfortunately; the cert values (branch
names) are all base64 encoded (with a trailing \n), so you need to do
something awful like:
FROM=$(echo -n $OLD_BRANCH | mimencode)
IDS=$(monotone debug "$(printf "select id from manifest_certs where
name='branch' and value='%s\n'" $FROM)" | grep -v row)
monotone debug "$(printf "delete from manifest_certs where name='branch'
and value='%s\n'" $FROM)"
for i in $IDS
do
monotone cert manifest manifest $i branch $NEW_BRANCH
done
I tried the above commands in the following way:
#!/bin/bash
ARCHIVE=/home/gs/monotone/test.db
OLD_BRANCH=Test
NEW_BRANCH=test
FROM=$(echo -n $OLD_BRANCH | mimencode)
IDS=$(monotone --db=$ARCHIVE debug "$(printf "select id from
manifest_certs where name='branch' and value='%s\n'" $FROM)" | grep -v row)
monotone --db=$ARCHIVE debug "$(printf "delete from manifest_certs where
name='branch' and value='%s\n'" $FROM)"
for i in $IDS
do
monotone --db=$ARCHIVE cert manifest manifest $i branch $NEW_BRANCH
done
That script failed with the following error message:
'delete from manifest_certs where name='branch' and value='VGVzdA==
'' -> 0 rows
Usage: monotone [OPTION...] command [ARGS...]
[...]
The old branch "Test" vanished from the output of "list branches"
though. So something must have changed in the database. But the new
branch name doesn't appear.
Is there any mistake in my script? What else can I try?
it'll probably be more sensible to make a "monotone branch rename"
command which does this internally, since it's so awful.
Yes, that would be very nice.
Thanks for your help
Gerhard