monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Root directory name in inventory


From: Stephen Leake
Subject: Re: [Monotone-devel] Root directory name in inventory
Date: Tue, 25 Sep 2007 05:01:39 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/22.1 (windows-nt)

Nathaniel Smith <address@hidden> writes:

> I just stumbled across this code in CMD_AUTOMATE(inventory):
>
>       if (i->first.as_internal() == "")
>         {
>           // This is the workspace root directory; print a nicer name.
>           st.push_str_pair(syms::path, ".");
>         }
>       else
>         {
>           //  Not the root directory
>           st.push_file_pair(syms::path, i->first);
>         }
>
> While I'm generally sympathetic to the idea of presenting the root
> directory in some more user-friendly name, it seems a bit odd to have
> an ad hoc user-friendly of writing it in a non-user-friendly
> interface.  

Yes.

> Especially since it will still need special-case handling by
> consumers of the API (no other directory name starts with ".", for
> instance), 

Right. In fact, Emacs DVC currently gets this wrong; it thinks root is
printed as "" (I lost track while chasing a changing interface, even
though I was writing both sides :).

> it isn't needed to make things parseable (since basic_io is quoted,
> empty strings are perfectly easy to represent), 

Right.

> and it actually makes inventory inconsistent with the rest of the
> automate API (I'm thinking in particular of things like 'automate
> get_revision' and 'automate get_manifest_of').
>
> Does anyone want to defend this, or should we just axe it?

There used to be more code in the special case, but that went away. I
don't think we ever had a good reason for "." vs "".

I just made that change, and a few corresponding changes in the tests,
and the tests still pass. I had thought there might some other
dependencies.

So I don't have any problem displaying root as "" here.

If no one else speaks up, I'll commit those changes.

-- 
-- Stephe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]