monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Tailor


From: Brian May
Subject: Re: [Monotone-devel] Tailor
Date: Fri, 13 Oct 2006 15:07:26 +1000
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)

>>>>> "Brian" == Brian May <address@hidden> writes:

    Brian> oh yuck. It looks like mtn just allowed me to commit a
    Brian> changeset that it can't handle.

Please ignore this comment. Yes, monotone did crash, but not because
of the changeset being broken, rather it was because monotone is
getting confused with an "unknown" file I forgot to add (to be precise
=id). As such it can't delete the .arch-ids directory. This has
nothing to do with the tailor issues being discussed here.

To reproduce this (and also demonstrate that complex renames do work),
run this script:

=== cut ===
#!/bin/sh -ex

mkdir mtnbug.tmp
cd mtnbug.tmp
mtn --db=test.mtn db init
mtn --db=test.mtn setup --branch test --key "$1" test
cd test

echo data > file
mtn add file
mkdir .arch-ids
mtn add .arch-ids
echo data > .arch-ids/file.id
mtn add .arch-ids/file.id
mtn commit --message "first version"

version=`mtn automate get_base_revision_id`

mkdir file.tmp
mtn add file.tmp
mv file file.tmp/abc
mtn mv file file.tmp/abc
mkdir file.tmp/.arch-ids
mtn add file.tmp/.arch-ids
mv .arch-ids/file.id file.tmp/.arch-ids/abc.id
mtn mv .arch-ids/file.id file.tmp/.arch-ids/abc.id
touch file.tmp/.arch-ids/=id  #DELETE HERE
#mtn commit --message "temp file version"

mv file.tmp file
mtn mv file.tmp file
mtn commit --message "final version"

mtn update --revision="$version"
=== cut ===

As is I get:

+ mtn update --revision=b259419fde522470bf5cf9ada1f7c3b46314906e
mtn: selected update target b259419fde522470bf5cf9ada1f7c3b46314906e
mtn: renaming file/.arch-ids/abc.id to .arch-ids/file.id
mtn: renaming file/abc to file
mtn: dropping file/.arch-ids
mtn: error: could not remove '_MTN/tmp/3'
mtn: error: Directory not empty

(The error occurring in the temp directory really confused me.)

If I delete the line "#DELETE HERE" it works. Hence, monotone can deal
with these complex renames quite OK; although the messages displayed
are slightly confusing:

+ mtn update --revision=b259419fde522470bf5cf9ada1f7c3b46314906e
mtn: selected update target b259419fde522470bf5cf9ada1f7c3b46314906e
mtn: renaming file/.arch-ids/abc.id to .arch-ids/file.id
mtn: renaming file/abc to file
mtn: dropping file/.arch-ids
mtn: dropping file
mtn: updated to base revision b259419fde522470bf5cf9ada1f7c3b46314906e

I suspect the same thing will happen whenever a directory is deleted
by an update that still contains non-versioned files.

Another issue is that after such an error occurs, the working
directory is very much screwed up (many files not existing that should
exist and vice versa), and _MTN/tmp must be deleted manually too. mtn
update really needs to be atomic - either it works or it does nothing.
-- 
Brian May <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]