[darcs-users] problem with rollbacking remove & pulling

Korusef korusef at gmail.com
Tue Oct 18 19:02:38 UTC 2005


The problem:
Create file, delete it in one branch, modify it in another branch.
Now you've found out, that the deletion was wrong move and to prevent it
from spreading, you want to rollback it and pull the correct modification to
the main branch.
The problem is, that the result depends, whether you do first rollbacking or
pulling.

Here is the script with behavior as expected:
#Cleans projects
rm -rf master offender user[1-2] rescue;

#Creates new repository with files in it
mkdir master;
cd master;
scrad initialize;
echo "fileI" >> "fileI";
echo 'master' >> file;
scrad record --look-for-adds --all --skip-long-comment --patch-name="Initial
import.";
cd ..;

#Makes a couple of branches
scrad get master user1;
scrad get master offender;

#Deletes fileI
rm -f offender/fileI;
echo 'offender remove' >> offender/file;
scrad record --all --skip-long-comment --patch-name="offender remove"
--repodir=offender;

#Modifies fileI
echo "user1" >> "user1/fileI";
echo 'next user1' >> user1/file;
scrad record --all --look-for-adds --skip-long-comment --patch-name="next
user1" --repodir=user1;

#Tries to merge the branches together
scrad get master rescue;

scrad pull --all --repodir=rescue $(pwd)/user1;
#bug:#560: local pull and absolute paths

scrad pull --all --patch='offender remove' --repodir=rescue $(pwd)/offender;
echo -n 'y' | scrad rollback --patch='offender remove' --repodir=rescue;
echo -n 'y' | scrad revert --all --repodir=rescue;

exit 0

The result:
$cat rescue/file*
master
next user1
fileI
user1
---lden8181 at u-pl46%~/BIG/test---
$cd rescue/
---lden8181 at u-pl46%~/BIG/test/rescue---
$darcs changes --verbose
Tue Oct 18 20:43:43 CEST 2005 korusef at matfyz.cz
UNDO: offender remove

M! ./file +1
M! ./fileI +1

Tue Oct 18 20:43:43 CEST 2005 korusef at matfyz.cz
* offender remove

M! ./file -1
M! ./fileI -1

Tue Oct 18 20:43:43 CEST 2005 korusef at matfyz.cz
* next user1

M ./file +1
M ./fileI +1

Tue Oct 18 20:43:42 CEST 2005 korusef at matfyz.cz
* Initial import.

A ./file
A ./fileI

Now if you first pull and rollback from offender and then pull from user1,
the result will be different:
$ cat rescue/file*
master
fileI
---lden8181 at u-pl46%~/BIG/test---
$cd rescue/
---lden8181 at u-pl46%~/BIG/test/rescue---
$darcs changes --verbose
Tue Oct 18 20:49:02 CEST 2005 korusef at matfyz.cz
* next user1


Tue Oct 18 20:49:02 CEST 2005 korusef at matfyz.cz
UNDO: offender remove

M ./file -1
A ./fileI

Tue Oct 18 20:49:02 CEST 2005 korusef at matfyz.cz
* offender remove

M ./file +1
R ./fileI

Tue Oct 18 20:49:01 CEST 2005 korusef at matfyz.cz
* Initial import.

A ./file
A ./fileI

Looks like the problem is that darcs doesn't recognise removed and UNDO
added fileI to be the same, but it also doesn't pull change in file.

You can suggest me to stick with the first case, but it doesn't help much,
because if the offender does some useful changes like this:
#Adds some useful patches
echo "elifI" >> "offender/elifI";
echo 'offender cover' >> offender/file;
scrad record --look-for-adds --all --skip-long-comment
--patch-name="offender cover" --repodir=offender;

And I'll try to get them:
scrad pull --all --repodir=rescue $(pwd)/offender;

I'll end with #267: bug in darcs: in function reconcile_unwindings.

Note: scrad == darcs (latest repository)

--
Zdravi Korusef [Libor Dener]
(: CauCau :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osuosl.org/pipermail/darcs-users/attachments/20051018/73ea1a42/attachment.htm 


More information about the darcs-users mailing list