[darcs-users] Changes of uncontrolled resources

Lele Gaifax lele at nautilus.homeip.net
Tue Aug 31 22:58:22 UTC 2004


>>>>> "Lele" == Lele Gaifax <lele at nautilus.homeip.net> writes:

>>>>> "David" == David Roundy <droundy at abridgegame.org> writes:
    David> The only better way I can think of would be to do a darcs
    David> changes --last 1 and look at the exit status.  This is a
    David> bit more efficient.  Significantly more efficient for truly
    David> large repos with long histories.

    Lele> I tried that, but doesn't seem to work::

    Lele>     sh-3.00$ mkdir not_under_darcs 
    Lele>     sh-3.00$ cd not_under_darcs/ 
    Lele>     sh-3.00$ darcs changes --last=1 . && echo "Ok" 
    Lele>     Changes to validation/not_under_darcs:

    Lele>     Ok

    Lele> Looking for an empty output may work, though.

David, any chance of "fixing" changes so that when given an
uncontrolled resource (be it a directory or a file) it raises an
exception like annotate does?

Consider the following example::

    $ mkdir p
    $ cd p
    $ darcs init
    Successfully initialized repository!
    $ mkdir dir
    $ darcs add dir
    $ cd dir
    $ touch file.txt
    $ darcs add file.txt
    $ cd ..
    $ darcs record -a -m "Initial"
    Finished recording patch 'Initial'
    $ touch uncontrolled.txt
    $ darcs changes uncontrolled.txt
    Changes to uncontrolled.txt:

    $ cd dir/
    $ touch uncontrolled.txt
    $ darcs changes uncontrolled.txt
    Changes to dir/uncontrolled.txt:

    Wed Sep  1 00:46:04 CEST 2004  lele at paci.nautilus
      * Initial

    $

This makes changes a bit misleading, in that is shows a change that is
not related to what was asked: at the very least it should not print
anything, like it does when the uncontrolled.txt is at the root of the
repos. 

As usual, I tried to understand how to do it, but failed to understand
what is going on after "lookup_pop" in Annotate.lhs, and whether it
could be used for changes too, sorry :|

thanks,
ciao, lele
-- 
nickname: Lele Gaifax	| Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas	| comincerò ad aver paura di chi mi copia.
email: lele at seldati.it	|		-- Fortunato Depero, 1929.





More information about the darcs-users mailing list