monotone

Issue 148: 'mtn list unknown' omits items in an unknown directory

Reported by joe 23, Feb 27, 2011

Case 1:

Steps to reproduce the problem:
-------------------------------

1. mkdir foo
2. touch foo/bar
3. mtn list unknown foo/bar

Expected result:
----------------
foo/bar

Actual results:
---------------
[no output]

I think this is a bug, since foo/bar was specified on the command 
line and it is not known.


Case 2:

Steps to reproduce the problem:
-------------------------------

1. mkdir foo
2. touch foo/bar
3. mtn list unknown foo

Expected result:
----------------
foo
foo/bar

Actual results:
---------------
foo

I consider this a bug also, but you could perhaps argue it is 'by 
design'.  I would prefer to see all files and directories under an 
unknown directory included in the 'mtn list unknown' output.



Output of `mtn version --full`:
-------------------------------
0.99.1

Comment 1 by Thomas Keller, Feb 27, 2011

This issue is related to issue 80.

Comment 2 by Stephen Leake, Aug 7, 2012

working in branch nvm.issue-148-80

A solution is implemented, but it's not clear it should be promoted 
to main. Summary:

In mtn 1.0, add had two different defaults for --recursive; when 
--unknown is specified, --recursive defaults to true, when --unknown 
is not specified, --recursive defaults to false.

The fix changes that. It adds the option --[no]-recursive to 'ls 
unknown' and 'ls ignored' (because that logic is used in 'add'). 
Now, for 'add', --unknown is orthogonal to --recursive, and the 
default for --recursive is false.

This preserves the mtn 1.0 behavior for 'mtn add' (except that the 
warning about some files not added is gone), but for 'mtn add 
--unknown', we now need to explicitly add '--recursive'.
Status: Started
Owner: stephe

Comment 3 by Stephen Leake, Aug 8, 2012

The situation in mtn 1.0 is more complicated; consider an example 
workspace:

known_dir_1
   unknown_file_1
   known_dir_2
      unknown_file_2
      unknown_dir_3
          unknown_file_3
          unknown_dir_4
             unknown_file_4

in mtn 1.0, 'ls unknown' lists:
known_dir_1/unknown_file_1
known_dir_1/known_dir_2/unknown_file_2
known_dir_1/known_dir_2/unknown_dir_3

in mtn 1.0, 'add --unknown' adds:
known_dir_1/unknown_file_1
known_dir_1/known_dir_2/unknown_file_2
known_dir_1/known_dir_2/unknown_dir_3
known_dir_1/known_dir_2/unknown_dir_3/unknown_file_3
known_dir_1/known_dir_2/unknown_dir_3/unknown_dir_

in nvm.issue-148-80, 'ls unknown' lists nothing, since there are no 
unknown dirs in the workspace root.

in nvm.issue-148-80, 'add --unknown' adds nothing.

in both branches 'add --unknown --recursive' adds all the unknown 
files.

In the typical case of a totally unknown workspace, mtn 1.0 'add 
--unknown' adds the files in the root and first layer directories. 
In nvm.issue-148-80, 'add -unknown' adds the files and dirs in the 
root directory, but not the files in the first layer.

Comment 4 by Stephen Leake, Aug 22, 2012

nvm.issue-148-80 propagated to main; issue fixed in 
fff999548e6d92a4d16280c7bfc346dff5353274
Status: Fixed

Created: 13 years 2 months ago by joe 23

Updated: 11 years 8 months ago

Status: Fixed

Owner: Stephen Leake

Followed by: 1 person

Labels:
Type:Defect
Priority:Medium

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status