[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Re: xmtn--file-registered-p for .mtn-ignore
From: |
Christian Ohler |
Subject: |
[Monotone-devel] Re: xmtn--file-registered-p for .mtn-ignore |
Date: |
Sun, 26 Aug 2007 16:25:37 +0200 |
Stephen Leake, 2007-07-20:
Christian Ohler <address@hidden> writes:
Christian Ohler, 2007-07-08:
In the mtn-has-basic-io-inventory case, it should be possible to speed
this up somewhat by passing the file name we're looking for to mtn
automate inventory. This will avoid generating the entire inventory.
Turns out that this is not possible: mtn automate inventory will fail
with an error if we pass it a file name that is not registered in the
manifest.
I guess this could be considered a bug in monotone.
Yes; it should show as unknown.
A restriction that includes only unregistered files makes little
sense for most commands, so I can see why monotone rejects it, but
it is meaningful for inventory.
Right.
Can you add a test case in
monotone.basic_io.inventory/tests/automate_inventory_path ?
Sorry for the delay. Here's my attempt at a patch to add such a test
case to monotone.
Christian.
#
# old_revision [a4c5bfb15107b710608ffea218128191fbbd0f9f]
#
# patch "tests/automate_inventory_restricted/__driver__.lua"
# from [1aacea01020abd0928e79bb01f5cd5dd89b73e81]
# to [ba54b738109ffc0cc161411dc983d839e2be43ed]
#
============================================================
--- tests/automate_inventory_restricted/__driver__.lua
1aacea01020abd0928e79bb01f5cd5dd89b73e81
+++ tests/automate_inventory_restricted/__driver__.lua
ba54b738109ffc0cc161411dc983d839e2be43ed
@@ -25,6 +25,7 @@ addfile("dir_b/file_b", "original: dir_b
addfile("file_0", "original: root file_0")
addfile("dir_a/file_a", "original: dir_a file_a")
addfile("dir_b/file_b", "original: dir_b file_b")
+writefile("unversioned_file", "contents of unversioned file")
commit()
-- Test that 'automate inventory' shows all directories
@@ -74,8 +75,17 @@ index = check_inventory (parsed, index,
fs_type = "file",
status = {"known"}})
--- skip the test files in root
+-- skip tester-generated files
+index = index + 3 * 10
+index = check_inventory (parsed, index,
+{ path = "unversioned_file",
+ fs_type = "file",
+ status = {"unknown"}})
+
+-- prove that we checked all the output
+checkexp ("checked all", #parsed, index-1)
+
----------
-- Test that 'automate inventory --depth=0' shows only the files in root
@@ -115,6 +125,11 @@ index = index + 3 * 10
-- skip tester-generated files
index = index + 3 * 10
+index = check_inventory (parsed, index,
+{ path = "unversioned_file",
+ fs_type = "file",
+ status = {"unknown"}})
+
-- prove that we checked all the output
checkexp ("checked all", #parsed, index-1)
@@ -288,6 +303,11 @@ index = index + 3 * 10
-- skip tester-generated files
index = index + 3 * 10
+index = check_inventory (parsed, index,
+{ path = "unversioned_file",
+ fs_type = "file",
+ status = {"unknown"}})
+
checkexp ("checked all", #parsed, index-1)
----------
@@ -331,6 +351,30 @@ index = index + 3 * 10
-- skip tester-generated files
index = index + 3 * 10
+index = check_inventory (parsed, index,
+{ path = "unversioned_file",
+ fs_type = "file",
+ status = {"unknown"}})
+
checkexp ("checked all", #parsed, index-1)
+----------
+-- Test that restriction to unversioned file works
+
+xfail(mtn("automate", "inventory", "unversioned_file"), 0, true, false)
+
+parsed = parse_basic_io(readfile("stdout"))
+index = 1
+
+-- skip tester-generated files
+index = index + 3 * 10
+
+index = check_inventory (parsed, index,
+{ path = "unversioned_file",
+ fs_type = "file",
+ status = {"unknown"}})
+
+-- prove that we checked all the output
+checkexp ("checked all", #parsed, index-1)
+
-- end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-devel] Re: xmtn--file-registered-p for .mtn-ignore,
Christian Ohler <=