From c7feccd7edb0a4f7051befcdafbafbdf7c221f74 Mon Sep 17 00:00:00 2001 From: Tsz-wo Sze Date: Thu, 15 Mar 2012 23:53:37 +0000 Subject: [PATCH] Revert previous commit r1301273 for HADOOP-8175. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1301282 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 7 ++----- .../main/java/org/apache/hadoop/fs/shell/Mkdir.java | 10 ++-------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 46251b14e31..eba60c1315f 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -290,8 +290,8 @@ Release 0.23.2 - UNRELEASED INCOMPATIBLE CHANGES - NEW FEATURES - + NEW FEATURES + IMPROVEMENTS HADOOP-8048. Allow merging of Credentials (Daryn Sharp via tgraves) @@ -305,10 +305,7 @@ Release 0.23.2 - UNRELEASED HADOOP-8137. Added links to CLI manuals to the site. (tgraves via acmurthy) - HADOOP-8175. FsShell: Add -p option to mkdir. (Daryn Sharp via szetszwo) - OPTIMIZATIONS - HADOOP-8071. Avoid an extra packet in client code when nagling is disabled. (todd) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java index 2f2e4e59a45..30ce5ed4dfd 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Mkdir.java @@ -43,21 +43,16 @@ public static void registerCommands(CommandFactory factory) { public static final String DESCRIPTION = "Create a directory in specified location."; - private boolean createParents; - @Override protected void processOptions(LinkedList args) { - CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, "p"); + CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE); cf.parse(args); - createParents = cf.getOpt("p"); } @Override protected void processPath(PathData item) throws IOException { if (item.stat.isDirectory()) { - if (!createParents) { - throw new PathExistsException(item.toString()); - } + throw new PathExistsException(item.toString()); } else { throw new PathIsNotDirectoryException(item.toString()); } @@ -65,7 +60,6 @@ protected void processPath(PathData item) throws IOException { @Override protected void processNonexistentPath(PathData item) throws IOException { - // TODO: should use createParents to control intermediate dir creation if (!item.fs.mkdirs(item.path)) { throw new PathIOException(item.toString()); }