#
# patch "ChangeLog"
# from [1c28a602d45adcdeca89eb9b1270c4be05988069]
# to [dc06fba2868bbb006f49aa90a4afd795a3c90397]
#
# patch "app_state.cc"
# from [213f36c8fef19703e626abf320c071df7f11279f]
# to [e17ca6062893530171e755833363cdcb237fa658]
#
# patch "automate.cc"
# from [edead711476caa2e44c15c6ff0baf506af4e1eb2]
# to [b110377e8696e41dda47f78a8486b649b4743c5a]
#
# patch "commands.cc"
# from [af8e266dfa5f781d5b2349577eb6ad9dab2832fa]
# to [3e72d872034c018c68dd5ba798fc5e60fc365ac1]
#
# patch "diff_patch.cc"
# from [33ff3e3f0e333c53219315885fba81732282dd03]
# to [667b6faf980f57be57fbf88a600fc457d6974ded]
#
# patch "work.cc"
# from [05d5c32cb54e9701beff52303846ce1d2c7bb35c]
# to [af15f9e1f0db47708560ffe59fb07f845de49eef]
#
========================================================================
--- ChangeLog 1c28a602d45adcdeca89eb9b1270c4be05988069
+++ ChangeLog dc06fba2868bbb006f49aa90a4afd795a3c90397
@@ -1,5 +1,12 @@
2005-08-25 Nathaniel Smith
+ * Audit uses of 'file_exists', because its semantics have changed;
+ it now checks to see if a path exists and is a regular file,
+ rather than that it simply exists. A fair amount of code already
+ thought it meant that... other places now use 'path_exists'.
+
+2005-08-25 Nathaniel Smith
+
* file_io.cc (path_exists, directory_exists, file_exists):
Implement.
========================================================================
--- app_state.cc 213f36c8fef19703e626abf320c071df7f11279f
+++ app_state.cc e17ca6062893530171e755833363cdcb237fa658
@@ -397,7 +397,7 @@
get_options_path(o_path);
try
{
- if (file_exists(o_path))
+ if (path_exists(o_path))
{
data dat;
read_data(o_path, dat);
========================================================================
--- automate.cc edead711476caa2e44c15c6ff0baf506af4e1eb2
+++ automate.cc b110377e8696e41dda47f78a8486b649b4743c5a
@@ -701,7 +701,7 @@
i = included.added_files.begin();
i != included.added_files.end(); ++i)
{
- if (file_exists(*i))
+ if (path_exists(*i))
{
// add path from [] to [xxx]
hexenc ident;
========================================================================
--- commands.cc af8e266dfa5f781d5b2349577eb6ad9dab2832fa
+++ commands.cc 3e72d872034c018c68dd5ba798fc5e60fc365ac1
@@ -1653,7 +1653,7 @@
for (path_set::const_iterator i = new_paths.begin(); i != new_paths.end(); ++i)
{
- if (app.restriction_includes(*i) && !file_exists(*i))
+ if (app.restriction_includes(*i) && !path_exists(*i))
cout << *i << endl;
}
}
@@ -2123,7 +2123,7 @@
}
file_path path = file_path_external(idx(args,1));
- N(file_exists(path), F("file '%s' not found") % path);
+ N(path_exists(path), F("file '%s' not found") % path);
bool attrs_modified = false;
========================================================================
--- diff_patch.cc 33ff3e3f0e333c53219315885fba81732282dd03
+++ diff_patch.cc 667b6faf980f57be57fbf88a600fc457d6974ded
@@ -700,8 +700,9 @@
{
data tmp;
file_id fid;
- N(file_exists (path),
- F("file %s does not exist in working copy") % path);
+ require_path_is_file(path,
+ F("file '%s' does not exist in working copy") % path,
+ F("'%s' in working copy is a directory, not a file") % path)
read_localized_data(path, tmp, app.lua);
calculate_ident(tmp, fid);
N(fid == ident,
========================================================================
--- work.cc 05d5c32cb54e9701beff52303846ce1d2c7bb35c
+++ work.cc af15f9e1f0db47708560ffe59fb07f845de49eef
@@ -96,7 +96,7 @@
for (vector::const_iterator i = paths.begin(); i != paths.end(); ++i)
{
N(!i->empty(), F("invalid path ''"));
- N(directory_exists(*i) || file_exists(*i),
+ N(path_exists(*i),
F("path %s does not exist\n") % *i);
walk_tree(*i, build);
@@ -119,7 +119,7 @@
data attr_data;
attr_map attrs;
- if (file_exists(attr_path))
+ if (path_exists(attr_path))
{
read_data(attr_path, attr_data);
read_attr_map(attr_data, attrs);
@@ -189,7 +189,7 @@
data attr_data;
attr_map attrs;
- if (file_exists(attr_path))
+ if (path_exists(attr_path))
{
read_data(attr_path, attr_data);
read_attr_map(attr_data, attrs);
@@ -275,7 +275,7 @@
file_path attr_path;
get_attr_path(attr_path);
- if (file_exists(attr_path))
+ if (path_exists(attr_path))
{
data attr_data;
read_data(attr_path, attr_data);
@@ -376,8 +376,9 @@
bookkeeping_path c_path;
get_revision_path(c_path);
- N(file_exists(c_path),
- F("working copy is corrupt: %s does not exist\n") % c_path);
+ require_path_is_file(c_path,
+ F("working copy is corrupt: %s does not exist") % c_path,
+ F("working copy is corrupt: %s is a directory") % c_path);
data c_data;
L(F("loading revision id from %s\n") % c_path);