On Sun, Nov 30, 2008 at 06:28:34PM -0500, Norman Ramsey wrote:
> I want something that *works*, not something that probably works most
> of the time.  That means if I'm sitting in compiler/cmm and try to add
> CmmParse.hs as a boring file, I don't have to worry about the pathname
> relative to _darcs---the tool should figure it out.

The best I can think of (while waiting for getpref) is parsing
the output of show repo and concatenate the values of Root and
boringfile Pref (defaulting boringfile Pref to
_darcs/prefs/boring if it is not set).

  ; darcs show repo
            Type: darcs
          Format: hashed, darcs-2
            Root: /home/tommy/tmp/foo
        Pristine: HashedPristine
           Cache: thisrepo:/home/tommy/tmp/foo, cache:/home/tommy/.darcs/cache
  boringfile Pref: d/f
     Num Patches: 1

This will give an absolute path to the boringfile no matter
where in the repo you are. A quick test shows it works with
non-ascii chars in the path too. Hm well, it doesn't work with
newlines in the path, but I think that can pass.

O my, after changing the boringfile to 'a\nb', and than to
something else, I have a line with a 'b' in _darcs/prefs/prefs. :-)


-- 
Tommy Pettersson <[EMAIL PROTECTED]>
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to