Today I faced a strange problem, and spent some time to investigate.
The source of the problem is that I added a new subtree to my
repository, and the subtree is named "something.core".
As I discovered, by default darcs boring rules match that name:
# core dumps
(^|/|\.)core$
which seems wrong by its own.
Regardless, as esemplified here below, darcs creates a patch where the
root of the subtree is NOT present, and that by the rules of the game
is invalid, even if the whole repository is clonable.
The following script:
#!/bin/sh
echo
echo "*** Creating bad patch"
cd /tmp
rm -rf darcs-boring-issue darcs-boring-issue-*
mkdir darcs-boring-issue
cd darcs-boring-issue
darcs --version
darcs init
mkdir src
darcs add src
darcs record -a -m "Added src directory" src
cd src
mkdir pcommerce.core
touch pcommerce.core/__init__.py
darcs add --recur pcommerce.core
darcs record -a -m "Added 3rd party subtree" pcommerce.core
darcs changes -s
echo
echo "*** A complete clone works"
cd /tmp
darcs get darcs-boring-issue darcs-boring-issue-clone
darcs-2.4.4 get darcs-boring-issue darcs-boring-issue-clone-2.4
echo
echo "*** One patch at a time does not (darcs 2.5)"
mkdir darcs-boring-issue-one-at-a-time
cd darcs-boring-issue-one-at-a-time
darcs init
darcs pull -a -p "Added src directory" ../darcs-boring-issue
darcs pull -a ../darcs-boring-issue
echo
echo "*** One patch at a time does not (darcs 2.4)"
mkdir darcs-boring-issue-one-at-a-time-with-2.4
cd darcs-boring-issue-one-at-a-time-with-2.4
darcs-2.4.4 init
darcs-2.4.4 pull -a -p "Added src directory" ../darcs-boring-issue
darcs-2.4.4 pull -a ../darcs-boring-issue
echo
echo "*** Creating bad patch (2.4)"
cd /tmp
mkdir darcs-boring-issue-2.4
cd darcs-boring-issue-2.4
darcs-2.4.4 --version
darcs-2.4.4 init
mkdir src
darcs-2.4.4 add src
darcs-2.4.4 record -a -m "Added src directory" src
cd src
mkdir pcommerce.core
touch pcommerce.core/__init__.py
darcs-2.4.4 add --recur pcommerce.core
darcs-2.4.4 record -a -m "Added 3rd party subtree" pcommerce.core
darcs-2.4.4 changes -s
produces the following here:
$ sh darcs-boring-issue.sh
*** Creating bad patch
2.5 (release)
Recording changes in "src":
Finished recording patch 'Added src directory'
Skipping boring file src/pcommerce.core
Recording changes in "src/pcommerce.core":
Finished recording patch 'Added 3rd party subtree'
Mon Feb 28 19:37:46 CET 2011 lele@metapensiero.it
* Added 3rd party subtree
A ./src/pcommerce.core/__init__.py
Mon Feb 28 19:37:45 CET 2011 lele@metapensiero.it
* Added src directory
A ./src/
*** A complete clone works
Note: if you want to change the default remote repository to
/tmp/darcs-boring-issue,
quit now and issue the same command with the --set-default flag.
Copying patches, to get lazy repository hit ctrl-C...
Finished getting.
Copying patches, to get lazy repository hit ctrl-C...
Finished getting.
*** One patch at a time does not (darcs 2.5)
Note: if you want to change the default remote repository to
/tmp/darcs-boring-issue,
quit now and issue the same command with the --set-default flag.
Finished pulling and applying.
Note: if you want to change the default remote repository to
/tmp/darcs-boring-issue,
quit now and issue the same command with the --set-default flag.
Warning: ./src/pcommerce.core/__init__.py-0:
takeFile ./src/pcommerce.core/__init__.py-0
in /tmp/darcs-boring-issue-one-at-a-time: does not exist (No such
file or directory) Finished pulling and applying.
*** One patch at a time does not (darcs 2.4)
darcs failed: Not a
repository: /tmp/darcs-boring-issue-one-at-a-time/darcs-boring-issue
(/tmp/darcs-boring-issue-one-at-a-time/darcs-boring-issue/_darcs/inventory:
openBinaryFile: does not exist (No such file or directory))
darcs failed: Not a
repository: /tmp/darcs-boring-issue-one-at-a-time/darcs-boring-issue
(/tmp/darcs-boring-issue-one-at-a-time/darcs-boring-issue/_darcs/inventory:
openBinaryFile: does not exist (No such file or directory))
*** Creating bad patch (2.4)
2.4.4 (release)
Recording changes in "src":
Finished recording patch 'Added src directory'
Skipping boring file src/pcommerce.core
Skipping 'src/pcommerce.core/__init__.py' ... couldn't add parent
directory 'src/pcommerce.core' to repository.
darcs failed: No files were added
Recording changes in "src/pcommerce.core":
No changes in selected files or directories!
Mon Feb 28 19:51:53 CET 2011 lele@metapensiero.it
* Added src directory
A ./src/
|