# # patch "ChangeLog" # from [c1a0e071ee0e6cb05c0886ebdd5262fedebfea29] # to [b59268b9528c6730dda9e7115473173b59cd0e2c] # # patch "commands.cc" # from [0219fa13f31351d209832ea210bb1e7a46bef761] # to [2b9bb2299e2fe0f337e33d1989d6f3f6d8c793c7] # # patch "tests/t_cat_file_by_name.at" # from [009033538c4424ad6994c33eef9dab24bef15980] # to [45f9704b56b2b74f16c5579539bc1c6f777b1e56] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,9 @@ +2005-06-16 Nathaniel Smith + + * commands.cc (cat): Account for being in a subdir in 'cat file + REV PATH'. + * tests/t_cat_file_by_name.at: Test. + 2005-06-16 Nathaniel Smith * std_hooks.lua (ignore_file): Add Cons/SCons cache files to --- commands.cc +++ commands.cc @@ -1370,7 +1370,7 @@ { revision_id rid; complete(app, idx(args, 1)(), rid); - file_path fp(idx(args, 2)()); + file_path fp = app.prefix(idx(args, 2)); manifest_id mid; app.db.get_revision_manifest(rid, mid); manifest_map m; --- tests/t_cat_file_by_name.at +++ tests/t_cat_file_by_name.at @@ -7,10 +7,14 @@ ]) AT_DATA(r1testfile, [r1 test file ]) +AT_DATA(subfile, [data in subfile +]) AT_CHECK(cp r0testfile testfile) AT_CHECK(cp r0otherfile otherfile) -AT_CHECK(MONOTONE add testfile otherfile, [], [ignore], [ignore]) +AT_CHECK(mkdir subdir) +AT_CHECK(cp subfile subdir/testfile) +AT_CHECK(MONOTONE add testfile otherfile subdir/testfile, [], [ignore], [ignore]) COMMIT(testbranch) R0=`BASE_REVISION` @@ -30,6 +34,12 @@ AT_CHECK(CANONICALISE(stdout)) AT_CHECK(cmp stdout r1testfile, [], [ignore]) +CHECK_SAME_CANONICALISED_STDOUT(cd subdir && MONOTONE cat file $R0 testfile, cat subfile) + +AT_CHECK(rm -rf MT) + +CHECK_SAME_CANONICALISED_STDOUT(MONOTONE cat file $R0 testfile, cat r0testfile) + AT_CHECK(MONOTONE cat file $R0 no_such_file, [1], [ignore], [ignore]) AT_CHECK(MONOTONE cat file $R0 "", [1], [ignore], [ignore])