[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] monotone diff failure
From: |
Lorenzo Campedelli |
Subject: |
[Monotone-devel] monotone diff failure |
Date: |
Sat, 07 Aug 2004 23:36:01 +0200 |
User-agent: |
Mozilla Thunderbird 0.7.3 (X11/20040803) |
Hello,
I wish to report a problem I have with the presence
of equal files in a monotone repository.
The small script I attached shows the problem.
In short, if two files are both changed to make them
equal, then monotone diff says that one file was
changed, while the other was deleted.
I studied the sources a little bit and I think the
problem comes from tha handling of path_id_bijection
in patch_set.cc.
A comment there says the following:
"
// nb: we preserve the bijective property of this map at the expense of
// possibly missing some add/delete matching cases. for example, if an
// identical file is deleted as one path name and added as two new path
// names, we will record it as an add + a move, rather than anything
// more clever.
"
But in case two files are equal in the tree, the relationship
between the pathname and the hash cannot be a bijection, right?
I tried to find a solution to this, maybe by using a one-to-many
association from hash to pathnames, but the current bijection
concept seems very deeply rooted in the code around there...
Is it possible to get around this problem? Am I the only one
who happens to have files with the same content in a tree
stored in monotone?
Thanks in advance,
Lorenzo
P.S.: I would not give the impression I'm complaining too much ;-),
thank you for the impressive work you've done, I find monotone is
the best such tool I can use now anyway...
#!/bin/bash
dbfile=testdb.db
branch=main
address@hidden
pass=z
rm -rf $dbfile file1 file2 MT
# Initialize DB
monotone --db=$dbfile db init
# Generate keys
(echo "$pass" && echo "$pass") | monotone --db=$dbfile genkey $user
# Create 2 files
echo "content1" > file1
echo "content2" > file2
# Add files to the main branch and commit
monotone --db=$dbfile --branch=$branch add file1 file2
echo $pass | monotone --db=$dbfile commit 'Commit message.'
# Now change the files to make them equal
echo "content3" > file1
echo "content3" > file2
# and ask monotone a difference
monotone --db=$dbfile diff
- [Monotone-devel] monotone diff failure,
Lorenzo Campedelli <=