# # # patch "ChangeLog" # from [8ae8207471b974a1918ef0b6bbac2359f43a197a] # to [a9374431e17f186b50eed59d40d56f7a9921a726] # # patch "cmd_files.cc" # from [76d3b9b014db08a72b73ae8b8ca6ae052f3e3896] # to [180ee596a5ca3008d4ba94215d821e769f81a6b9] # # patch "contrib/dtrace2calltree.py" # from [3faf2b1b54435463e36002b6e01a268a977daa02] # to [9f5f2a9d3584ae8918f446d46736eb25175e5930] # # patch "tests/t_annotate.at" # from [d3aa446ce87ede39db51ee26af7c5f1f8009c0a2] # to [9012c5c45dc850682a8b7ce52b0a76ac71b41a28] # ============================================================ --- ChangeLog 8ae8207471b974a1918ef0b6bbac2359f43a197a +++ ChangeLog a9374431e17f186b50eed59d40d56f7a9921a726 @@ -1,3 +1,8 @@ +2006-05-04 Nathaniel Smith + + * cmd_files.cc (annotate): Check whether file exists. + * tests/t_annotate.at: Test this check. + 2006-05-04 Matt Johnston * work.cc (editable_working_tree::apply_delta): filename argument ============================================================ --- cmd_files.cc 76d3b9b014db08a72b73ae8b8ca6ae052f3e3896 +++ cmd_files.cc 180ee596a5ca3008d4ba94215d821e769f81a6b9 @@ -88,8 +88,9 @@ roster_t roster; marking_map marks; app.db.get_roster(rid, roster, marks); + N(roster.has_node(sp), F("no such file '%s' in revision '%s'") % file % rid); node_t node = roster.get_node(sp); - N((!null_node(node->self) && is_file_t(node)), F("no file '%s' found in revision '%s'\n") % file % rid); + N(is_file_t(node), F("'%s' in revision '%s' is not a file") % file % rid); file_t file_node = downcast_to_file_t(node); L(FL("annotate for file_id %s\n") % file_node->self); ============================================================ --- contrib/dtrace2calltree.py 3faf2b1b54435463e36002b6e01a268a977daa02 +++ contrib/dtrace2calltree.py 9f5f2a9d3584ae8918f446d46736eb25175e5930 @@ -51,6 +51,18 @@ # ls`0x8051b2b # ls`main+0x637 # ls`0x8051106 +# +# syscall: 1234 fstat64 +# libc.so.1`mmap+0x15 +# libc.so.1`lmalloc+0x6c +# libc.so.1`atexit+0x1c +# libc.so.1`libc_init+0x40 +# ld.so.1`call_init+0x46 +# ld.so.1`setup+0xe2c +# ld.so.1`_setup+0x28c +# ld.so.1`_rt_boot+0x56 +# 0x80473dc +# #---------------- # See also: ============================================================ --- tests/t_annotate.at d3aa446ce87ede39db51ee26af7c5f1f8009c0a2 +++ tests/t_annotate.at 9012c5c45dc850682a8b7ce52b0a76ac71b41a28 @@ -44,6 +44,11 @@ COMMIT(testbranch) REV3=`BASE_REVISION` +# annotate on a non-existent file gives an error +AT_CHECK(MTN annotate nonexistent, [1], [ignore], [ignore]) +# annotate on dirs gives an error +AT_CHECK(MTN annotate ., [1], [ignore], [ignore]) + # # annotate foo0 should now be # REV1: z