From 8b9f86fb17bac7cd1911edbd57e6421c20e30b09 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Mon, 17 Dec 2007 20:22:26 -0700
Subject: [PATCH] remove the slash-to-bang conversion from CLI tools and
 webapi.txt

---
 docs/webapi.txt                    | 8 --------
 src/allmydata/scripts/tahoe_get.py | 2 +-
 src/allmydata/scripts/tahoe_ls.py  | 2 +-
 src/allmydata/scripts/tahoe_mv.py  | 2 +-
 src/allmydata/scripts/tahoe_put.py | 2 +-
 src/allmydata/scripts/tahoe_rm.py  | 2 +-
 6 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/docs/webapi.txt b/docs/webapi.txt
index e2e6aa16..c4c3ab84 100644
--- a/docs/webapi.txt
+++ b/docs/webapi.txt
@@ -85,14 +85,6 @@ sequence of slash-separated pathnames following, or with "uri/" as the top
 level, followed by a URI, optionally followed by a sequence of
 slash-separated pathnames.
 
-Note that since tahoe URIs may contain slashes (in particular, dirnode URIs
-contain a FURL, which resembles a regular HTTP URL and starts with pb://),
-when URIs are used in this form, they must be specially quoted. All slashes
-in the URI must be replaced by '!' characters. The intent is to remove this
-unpleasant requirement in a future release: please see ticket #102 for
-details. An example of this sort of directory-URI URL is:
-
- http://localhost:8123/uri/URI%3ADIR%3Apb%3A!!xextf3eap44o3wi27mf7ehiur6wvhzr6%40207.7.153.180%3A56677%2C127.0.0.1%3A56677!vdrive%3Agqu1fub33exw9cu63718yzx6gr/
 
 Now, what can we do with these URLs? By varying the HTTP method
 (GET/PUT/POST/DELETE) and by appending a type-indicating query argument, we
diff --git a/src/allmydata/scripts/tahoe_get.py b/src/allmydata/scripts/tahoe_get.py
index 6696106c..af577228 100644
--- a/src/allmydata/scripts/tahoe_get.py
+++ b/src/allmydata/scripts/tahoe_get.py
@@ -5,7 +5,7 @@ import urllib
 def get(nodeurl, root_uri, vdrive_fname, local_file, stdout, stderr):
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
     if vdrive_fname:
         url += urllib.quote(vdrive_fname)
 
diff --git a/src/allmydata/scripts/tahoe_ls.py b/src/allmydata/scripts/tahoe_ls.py
index 9b69d314..f010ae02 100644
--- a/src/allmydata/scripts/tahoe_ls.py
+++ b/src/allmydata/scripts/tahoe_ls.py
@@ -6,7 +6,7 @@ import simplejson
 def list(nodeurl, root_uri, vdrive_pathname, stdout, stderr):
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
     if vdrive_pathname:
         url += urllib.quote(vdrive_pathname)
     url += "?t=json"
diff --git a/src/allmydata/scripts/tahoe_mv.py b/src/allmydata/scripts/tahoe_mv.py
index fd28c3a6..2306cc3f 100644
--- a/src/allmydata/scripts/tahoe_mv.py
+++ b/src/allmydata/scripts/tahoe_mv.py
@@ -10,7 +10,7 @@ def mv(nodeurl, root_uri, frompath, topath, stdout, stderr):
     topath = urllib.quote(topath)
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
     data = urllib.urlopen(url + frompath + "?t=json").read()
 
     nodetype, attrs = simplejson.loads(data)
diff --git a/src/allmydata/scripts/tahoe_put.py b/src/allmydata/scripts/tahoe_put.py
index 98f4c8bb..d2f046ae 100644
--- a/src/allmydata/scripts/tahoe_put.py
+++ b/src/allmydata/scripts/tahoe_put.py
@@ -12,7 +12,7 @@ def put(nodeurl, root_uri, local_fname, vdrive_fname, verbosity,
     """
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
     if vdrive_fname:
         url += urllib.quote(vdrive_fname)
 
diff --git a/src/allmydata/scripts/tahoe_rm.py b/src/allmydata/scripts/tahoe_rm.py
index 313639ee..e418ec35 100644
--- a/src/allmydata/scripts/tahoe_rm.py
+++ b/src/allmydata/scripts/tahoe_rm.py
@@ -11,7 +11,7 @@ def rm(nodeurl, root_uri, vdrive_pathname, verbosity, stdout, stderr):
     """
     if nodeurl[-1] != "/":
         nodeurl += "/"
-    url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+    url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
     if vdrive_pathname:
         url += urllib.quote(vdrive_pathname)
 
-- 
2.45.2