Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38489C58F for ; Thu, 19 Jul 2012 17:48:56 +0000 (UTC) Received: (qmail 49988 invoked by uid 500); 19 Jul 2012 17:48:55 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 49916 invoked by uid 500); 19 Jul 2012 17:48:55 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 49909 invoked by uid 99); 19 Jul 2012 17:48:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2012 17:48:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jul 2012 17:48:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AE9F32388860; Thu, 19 Jul 2012 17:48:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1363437 - in /hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common: CHANGES.txt src/main/java/org/apache/hadoop/fs/shell/Mkdir.java Date: Thu, 19 Jul 2012 17:48:33 -0000 To: common-commits@hadoop.apache.org From: bobby@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120719174833.AE9F32388860@eris.apache.org> Author: bobby Date: Thu Jul 19 17:48:33 2012 New Revision: 1363437 URL: http://svn.apache.org/viewvc?rev=1363437&view=rev Log: svn merge -c 1363435 FIXES: HADOOP-8551. fs -mkdir creates parent directories without the -p option (Daryn Sharp and John George via bobby) Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt?rev=1363437&r1=1363436&r2=1363437&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/CHANGES.txt Thu Jul 19 17:48:33 2012 @@ -654,6 +654,9 @@ Release 0.23.3 - UNRELEASED HADOOP-8599. Non empty response from FileSystem.getFileBlockLocations when asking for data beyond the end of file. (Andrey Klochkov via todd) + HADOOP-8551. fs -mkdir creates parent directories without the -p option + (Daryn Sharp and John George via bobby) + Release 0.23.2 - UNRELEASED NEW FEATURES Modified: hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java?rev=1363437&r1=1363436&r2=1363437&view=diff ============================================================================== --- hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java (original) +++ hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java Thu Jul 19 17:48:33 2012 @@ -26,6 +26,7 @@ import org.apache.hadoop.classification. import org.apache.hadoop.fs.shell.PathExceptions.PathExistsException; import org.apache.hadoop.fs.shell.PathExceptions.PathIOException; import org.apache.hadoop.fs.shell.PathExceptions.PathIsNotDirectoryException; +import org.apache.hadoop.fs.shell.PathExceptions.PathNotFoundException; /** * Create the given dir @@ -66,7 +67,9 @@ class Mkdir extends FsCommand { @Override protected void processNonexistentPath(PathData item) throws IOException { - // TODO: should use createParents to control intermediate dir creation + if (!item.parentExists() && !createParents) { + throw new PathNotFoundException(item.toString()); + } if (!item.fs.mkdirs(item.path)) { throw new PathIOException(item.toString()); }