monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] automate inventory


From: Derek Scherger
Subject: Re: [Monotone-devel] automate inventory
Date: Thu, 27 Apr 2006 22:30:14 -0600
User-agent: Mozilla Thunderbird 1.0.7 (X11/20060205)

Timothy Brownawell wrote:
Well, IIRC we're trying to use basic_io as our general data format. This
would be a lot more flexible than trying to keep the same
one-line-per-item style inventory uses now.

Maybe something like

           path "foo/bar.mp3"
        fs_type "file"
       old_type "dir"
       new_type "file"
         old_id "123"
         new_id "456"
        patched "true"
  attrs_changed "id3:title"
  attrs_cleared "mtn:exec"
    attrs_added "mtn:manual-merge" "id3:track"

    path "core"
 fs_type "file"
old_type "absent"
new_type "absent"

*_type can be "file", "dir", or "absent", and *_id is only present if
the matching *_type is not "absent".

I've finally mangaged to hack this up... here's some sample output snippets from the workspace I have the change sitting in:

    path ""
  old_id "64"
old_type "directory"
  new_id "64"
new_type "directory"
 fs_type "none"
  status "missing"
   attrs "unchanged"

   path ".am30736"
fs_type "directory"
 status "unknown"

   path ".deps"
fs_type "directory"
 status "ignored"

...

    path "automate.cc"
  old_id "2447"
old_type "file"
  new_id "2447"
new_type "file"
 fs_type "file"
  status "known"
 content "changed"
   attrs "unchanged"

...

    path "xdelta.hh"
  old_id "342"
old_type "file"
  new_id "342"
new_type "file"
 fs_type "file"
  status "known"
 content "unchanged"
   attrs "unchanged"

   path "xgettext.opts"
fs_type "file"
 status "unknown"

The first entry is mildly interesting: the root dir is listed as missing since there is no "" path in my workspace. In some ways I really wonder if the root path should be called "." and if all the other paths should be "./foo" but this is a rather invasive change to make.

The format is a bit different from Tim's suggestion in that {old,new}_{id,type} are only reported if the path exists in the old or new roster respectively. I wondered about combining the old new items into one line like:

        old_node "123" "file"
        new_node "456" "directory"

I'm not sure if optional lines like these are a good thing or not?

The fs_type line may be "file", "directory" or "none".

The status line will appear as "known", "missing", "unknown", "ignored" or "invalid" for paths in these states. Paths are "invalid" if the new roster and filesystem disagree on type (file vs dir). I wonder whether we should already something like ls_invalid for listing these.

The content line will only appear for files and may be "unchanged", "changed" or "unknown" (with the last used for missing/invalid files).

The attr line will always appear and may be "unchanged" or changed". I don't have it listing the individual set/cleared/changed attrs as Tim suggested as this seems inconsistent with what's being reported for content. To see content differences you need to use diff so why would inventory list detailed attr differences?

The output is obviously quite a bit more verbose with this format:

(proposed format)
$ ./mtn automate inventory|wc
  13645   23186  235023

(current format)
$ mtn automate inventory | wc
   1934    6647   59730

and hrm... mainline mtn fails in my workspace - one more reason we need to change! (the above is from a clean workspace)

I'm not sure about optional lines verses "unchanged" lines for things like status, content and attrs. Any preferences?


So, do we want to go ahead with this?

Cheers,
Derek





reply via email to

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