[darcs-users] deleting a repository

Albert Reiner areiner at tph.tuwien.ac.at
Mon Aug 22 12:15:10 UTC 2005


[Frederik Eaton <frederik at a5.repetae.net>, Sun, 21 Aug 2005 10:52:47 -0700]:
> You're setting up a straw man, I never proposed to change the
> directory. I don't even think you can delete the working directory
> (... you can't, you get EBUSY). In my example the repository was
> specified explicitly, as it would have to be since you're going to be
> outside of it.

If this is a straw man, where do I go wrong:

- In my understanding, "darcs release --repo=foo" should perform some
  checks and eventually get rid of the "foo" repo.

- AFAICT, all the other darcs commands work on the current repo
  whenever you leave out the --repo option.  So "darcs release" should
  get rid of the current repo.

- Getting rid of the repo implies that the repo directory should be
  removed.

- When operating on the current repo, I can see two options:

  - leave the user in a different directory; most likely, the one
    above the root of the repo;

  - leave the user in a removed directory.

It seems to me that the second option is more confusing to the darcs
novice this feature is meant to help.

Now consider:

,----[ foo.sh ]
| #!/bin/bash
| 
| dir="`pwd`"
| cd ..
| rm -rf "$dir"
| echo $?
`----

,----
| $ mkdir /tmp/foo1
| $ cd /tmp/foo1
| $ bash /tmp/foo.sh
| 0
| $ pwd
| /tmp/foo1
| $ /bin/pwd
| /bin/pwd: cannot get current directory: No such file or directory
| $ ls -d /tmp/foo1
| ls: /tmp/foo1: No such file or directory
`----

Compare this with:

,----
| $ mkdir /tmp/foo1
| $ cd /tmp/foo1
| $ . /tmp/foo.sh
| 0
| $ pwd
| /tmp
| $ /bin/pwd
| /tmp
| $ ls -d /tmp/foo1
| ls: /tmp/foo1: No such file or directory
`----

In the first case there is a mismatch between the shell built-in pwd
and /bin/pwd, and the user ends up in a directory that will go away
when he leaves it (provided no other process still uses it).  In the
second case there is no such problem, but AFAIK you cannot source
anything except a shell script.

Regards,

Albert.




More information about the darcs-users mailing list