summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IcePatch/Client.cpp')
-rw-r--r--cpp/src/IcePatch/Client.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/cpp/src/IcePatch/Client.cpp b/cpp/src/IcePatch/Client.cpp
index 6ae2bf494da..2d7447b7497 100644
--- a/cpp/src/IcePatch/Client.cpp
+++ b/cpp/src/IcePatch/Client.cpp
@@ -83,7 +83,7 @@ IcePatch::Client::run(int argc, char* argv[])
}
vector<string> subdirs;
- if (argc >= 1)
+ if (argc > 1)
{
for (int i = 1; i < argc; ++i)
{
@@ -210,6 +210,23 @@ IcePatch::Client::run(int argc, char* argv[])
DirectoryDescPtr topDesc = DirectoryDescPtr::dynamicCast(top->describe());
assert(topDesc);
string path = identityToPath(topDesc->directory->ice_getIdentity());
+ string::size_type pos = 0;
+ while (pos < path.size())
+ {
+ string::size_type pos2 = path.find('/', pos);
+ if (pos2 == string::npos)
+ {
+ pos2 = path.size();
+ }
+ string subPath = path.substr(0, pos2);
+ FileInfo subPathInfo = getFileInfo(subPath, false);
+ if (subPathInfo.type == FileTypeNotExist)
+ {
+ createDirectory(subPath);
+ cout << subPath << ": created" << endl;
+ }
+ pos = pos2 + 1;
+ }
cout << pathToName(path) << endl;
cout << "|" << endl;
patch(topDesc->directory->getContents(), "");