bugmonotone - Bugs: bug #17077, automate...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #17077: automate get_manifest_of/get_revision fail if there are missing files in the workspace

Submitter:  Thomas Keller <tommyd>
Submitted:  Mon 10 Jul 2006 02:49:58 PM UTC
Votes: 1
 
Category:  command line UI Severity:  3 - Normal
Item Group:  incorrect behavior Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
mtn version --full: 

monotone 0.27 (base revision: 341e4a18c594cec49896fa97bd4e74de7bee5827)
Running on          : Linux 2.6.17-1.2139_1.rhfc5.cubbi_suspend2 #1 Sun Jun 25 19:11:11 CEST 2006 i686
C++ compiler        : GNU C++ version 4.1.0 20060304 (Red Hat 4.1.0-3)
C++ standard library: GNU libstdc++ version 20060304
Boost version       : 1_33_1
Changes since base revision:
format_version "1"

new_manifest [8e9ac81ef37aa9c0334b97d46467a8ee61450078]

old_revision [341e4a18c594cec49896fa97bd4e74de7bee5827]

  Generated from data cached in the distribution;
  further changes may have been made.


Mon 06 Nov 2006 11:30:20 AM UTC, comment #3: 

automate attributes implemented in 0.29

Thomas Keller <tommyd>
Group administrator
Tue 18 Jul 2006 09:06:29 PM UTC, comment #2: 

Now this is interesting: Having literally scanned the HTML docs for the automate command "attributes" I couldn't find anything there, but `mtn automate`clearly lists it as supported command. I have to admit that I normally only look at the docs to find out if a certain feature is supported or not, and not the binary's help output. So, after all, this is at least a documentation bug =)

Looking at the sources in automate.cc told me that it was added back in 1.0 and can do two things:

a) called without a parameter it simply lists all files with attributes settings
b) called with a FILE parameter it lists all attributes for that particular file (or exits with no output if the file has no parameters)

Through my tests I could verify that

a) it works if the file is missing (has been removed from workspace but not from mtn)
b) it also lists attribute additions which are not yet committed (though those can't be distinguished from those which are already committed), but doesn't list those which are dropped but not yet committed
c) it doesn't output the attribute values

After all, yes, I'm for updating automate attributes (beside that it should finally get documented), and I still wonder whats the use case of getting a manifest or a revision via automate interface while this output is not 100% accurate in terms of error handling (I mean we don't live in a perfect world, why should both commands imply that in "their" universe).

Thomas Keller <tommyd>
Group administrator
Mon 17 Jul 2006 03:04:13 AM UTC, comment #1: 

No, I believe that what it does now is correct behavior: a manifest needs a hash for each included file, and if the file is missing it can't determine that; a revision has similar issues.

The proper fix would be to have another command that lists them, probably by updating 'automate attributes'.

Timothy Brownawell <tbrownaw>
Group Member
Mon 10 Jul 2006 02:49:58 PM UTC, original submission:  


get_manifest_of can be used in conjunction with get_revision to query attributes, which simply exist (manifest) or have been added/dropped (get_revision amongst other things).

Now, when a file is missing from the workspace of the user, because it has been deleted but not yet mtn drop'ed, get_manifest_of (and get_revision likewise) fail with

$ echo "l15:get_manifest_ofe^c" | LC_ALL=c mtn automate stdio
mtn: warning: missing build.sh
0:2:l:316:misuse: 1 missing files; use 'mtn ls missing' to view
misuse: to restore consistency, on each missing file run either
misuse: 'mtn drop FILE' to remove it permanently, or
misuse: 'mtn revert FILE' to restore it
misuse: or to handle all at once, simply 'monotone drop --missing'

(Note, that the mtn: warning is not part of the stdio output, but is echoed to stderr, but this is another thing)

This might be correct behaviour on the first look, but it isn't. automate inventory lists missing files as missing and does not bail out, giving my UI a chance to revert the item or drop it if the UI acknowledges it.
While the user can decide when he does this action (the item is still just displayed as "missing" in the meantime), he can't use other functionality, like listing attributes of existing files, because, yep, get_manifest_of fails completly (and not only for the one single item which is actually missing). So the user is stuck until he acts on the missing item.

Now, my UI might get the notice "there are one or more missing items" (which it has to painfully parse from the error output), but it can't tell the user what items are actually missing since this is outputted to STDERR and not STDOUT of automate stdio (see above). Also, there is no "ls missing" command available for stdio, so I can't get the info through this interface at all.

A minor fix would here to include the warning into the actual stdio output, but this doesn't fix the other problems, mainly that the error string hard to parse, not basic_io or anything, and that it shouldn't fail at all - since the attributes for the file should still be recorded in the base revision even if the file is missing, the same goes for the file id where the last committed file ID could be used for existing files and an empty file id could be outputted for just added, but missing files.

Even better would be (that would help me not getting a bunch of nightmares) to allow get_manifest_of to be optionally be called with a pathname, so it only outputs the attributes and file ID of the single item (then it can fail for missing files, since the rest of the UI isn't corrupted). And even better would be to add to this format the possibility to show added/dropped attributes so one hasn't to take care of get_revision as well just to get the information "show me all added, dropped and still existing attributes of a file".

Thomas Keller <tommyd>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-11-06 tommyd StatusNone Fixed
    Open/ClosedOpen Closed
2006-07-18 tommyd Carbon-Copy- Added tommyd

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code