# # # patch "cmd_ws_commit.cc" # from [a5f6214c20c9d96fb892e71b2cefab917e47c822] # to [140233dea97568ceea4d7d1064abbc978e06398d] # # patch "tests/undrop/__driver__.lua" # from [a26d7680d4abe92aada7e48f745b08b47e35fa10] # to [78a836b7694dfc46295051a5ea2adeff39bdb6ec] # ============================================================ --- cmd_ws_commit.cc a5f6214c20c9d96fb892e71b2cefab917e47c822 +++ cmd_ws_commit.cc 140233dea97568ceea4d7d1064abbc978e06398d @@ -315,7 +315,7 @@ revert(app_state & app, } else { - revert = not undrop; + revert = !undrop; } } ============================================================ --- tests/undrop/__driver__.lua a26d7680d4abe92aada7e48f745b08b47e35fa10 +++ tests/undrop/__driver__.lua 78a836b7694dfc46295051a5ea2adeff39bdb6ec @@ -77,4 +77,20 @@ check(mtn("undrop", "unchanged"), 0, fal -- this, so 'undrop' doesn't either. check(mtn("undrop", "unchanged"), 0, false, false) +-- drop a directory without --recursive gives an error, so 'undrop --recursive' is redundant +check(mtn("drop", "dir1"), 1, false, true) +check(qgrep("cannot remove dir1/, it is not empty", "stderr")) + +-- File that was dropped and committed cannot be undropped +check(mtn("drop", "changed"), 0, false, false) +commit() + +check(mtn("undrop", "changed"), 1, false, true) +check(qgrep("1 unknown path", "stderr")) + +-- Undrop a child of a directory that was dropped +check(mtn("drop", "--recursive", "dir1"), 0, false, true) +check(mtn("undrop", "dir1/file1"), 1, false, true) +check(qgrep("restriction excludes addition of 'dir1' but includes addition of 'dir1/file1'", "stderr")) + -- end of file