merge mozilla-central to fx-team
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 11 Sep 2013 13:57:03 +0200
changeset 146671 d4d34d4d06e762abafea07aa1c83c32704defe70
parent 146670 414c4654393196cfee6e1a43d521ce4b886d0175 (current diff)
parent 146519 5417e5da2cebc0d34ccc05b16be513b5d8a01e55 (diff)
child 146672 2a18454f0aa33f03aca93fba340c0b1bc0a25ea2
push idunknown
push userunknown
push dateunknown
milestone26.0a1
merge mozilla-central to fx-team
dom/interfaces/events/nsIDOMBlobEvent.idl
dom/power/nsIDOMPowerManager.idl
python/virtualenv/bin/refresh-support-files.py
python/virtualenv/docs/index.txt
python/virtualenv/docs/news.txt
python/virtualenv/virtualenv_embedded/distribute_from_egg.py
python/virtualenv/virtualenv_embedded/distribute_setup.py
python/virtualenv/virtualenv_embedded/ez_setup.py
python/virtualenv/virtualenv_support/distribute-0.6.31.tar.gz
python/virtualenv/virtualenv_support/pip-1.2.1.tar.gz
python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.5.egg
python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.6.egg
python/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "3014a433e3b78fa04aacb919c853fa220d309d70", 
+    "revision": "e3d925b497f5b996c9c397c200805fbcc62bc823", 
     "repo_path": "/integration/gaia-central"
 }
--- a/browser/devtools/webconsole/hudservice.js
+++ b/browser/devtools/webconsole/hudservice.js
@@ -1,9 +1,9 @@
-/* -*- Mode: js2; js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
+/* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cc, Ci, Cu} = require("chrome");
--- a/browser/devtools/webconsole/network-panel.js
+++ b/browser/devtools/webconsole/network-panel.js
@@ -1,9 +1,9 @@
-/* -*- Mode: js2; js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
+/* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cc, Ci, Cu} = require("chrome");
--- a/browser/devtools/webconsole/webconsole.js
+++ b/browser/devtools/webconsole/webconsole.js
@@ -1,9 +1,9 @@
-/* -*- Mode: js2; js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
+/* -*- js2-basic-offset: 2; indent-tabs-mode: nil; -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {Cc, Ci, Cu} = require("chrome");
--- a/build/annotationProcessors/CodeGenerator.java
+++ b/build/annotationProcessors/CodeGenerator.java
@@ -39,17 +39,16 @@ public class CodeGenerator {
                 "#ifdef DEBUG\n" +
                 "#define ALOG_BRIDGE(args...) ALOG(args)\n" +
                 "#else\n" +
                 "#define ALOG_BRIDGE(args...) ((void)0)\n" +
                 "#endif\n" +
                 "\n" +
                 "using namespace mozilla;\n" +
                 "void AndroidBridge::InitStubs(JNIEnv *jEnv) {\n" +
-                "    ALOG_BRIDGE(\"%s\", __PRETTY_FUNCTION__);\n" +
                 "    initInit();\n");
         // Now we write the various GetStaticMethodID calls here...
 
         headerFields.append("protected:\n\n");
         headerMethods.append(GENERATED_COMMENT);
         headerMethods.append("public:\n\n");
     }
 
@@ -119,18 +118,17 @@ public class CodeGenerator {
     private void writeMethodBody(String methodSignature, String aCMethodName, Method aMethod, Class<?> aClass, boolean aIsStaticBridgeMethod, boolean aIsMultithreaded) {
         Class<?>[] argumentTypes = aMethod.getParameterTypes();
         Class<?> returnType = aMethod.getReturnType();
 
         // The start-of-function boilerplate. Does the bridge exist? Does the env exist? etc.
         wrapperMethodBodies.append('\n');
         wrapperMethodBodies.append(methodSignature);
 
-        wrapperMethodBodies.append(" {\n" +
-                                   "    ALOG_BRIDGE(\"%s\", __PRETTY_FUNCTION__);\n");
+        wrapperMethodBodies.append(" {\n");
 
         // Static stubs check the bridge instance has been created before trying to run.
         if (aIsStaticBridgeMethod) {
             wrapperMethodBodies.append("    if (!sBridge) {\n" +
                                        "        ALOG_BRIDGE(\"Aborted: No sBridge - %s\", __PRETTY_FUNCTION__);\n" +
                                        "        return").append(Utils.getFailureReturnForType(returnType)).append(";\n" +
                                        "    }\n\n");
         }
@@ -262,28 +260,25 @@ public class CodeGenerator {
                                    "    }\n");
 
         // If we're returning an object, pop the callee's stack frame extracting our ref as the return
         // value.
         if (isObjectReturningMethod) {
             wrapperMethodBodies.append("    ");
             wrapperMethodBodies.append(Utils.getCReturnType(returnType));
             wrapperMethodBodies.append(" ret = static_cast<").append(Utils.getCReturnType(returnType)).append(">(env->PopLocalFrame(temp));\n" +
-                                       "    ALOG_BRIDGE(\"Exit of: %s\", __PRETTY_FUNCTION__);\n" +
                                        "    return ret;\n");
         } else if (!returnType.getCanonicalName().equals("void")) {
             // If we're a primitive-returning function, just return the directly-obtained primative
             // from the call to Java.
             wrapperMethodBodies.append("    env->PopLocalFrame(NULL);\n" +
-                                       "    ALOG_BRIDGE(\"Exit of: %s\", __PRETTY_FUNCTION__);\n" +
                                        "    return temp;\n");
         } else {
             // If we don't return anything, just pop the stack frame and move on with life.
-            wrapperMethodBodies.append("    ALOG_BRIDGE(\"Exit of: %s\", __PRETTY_FUNCTION__);\n" +
-                                       "    env->PopLocalFrame(NULL);\n");
+            wrapperMethodBodies.append("    env->PopLocalFrame(NULL);\n");
         }
         wrapperMethodBodies.append("}\n");
     }
 
     /**
      * Generates the code to get the method id of the given method on startup.
      *
      * @param aCMethodName    The C method name of the method being generated.
--- a/content/media/MediaRecorder.cpp
+++ b/content/media/MediaRecorder.cpp
@@ -5,22 +5,22 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MediaRecorder.h"
 #include "GeneratedEvents.h"
 #include "MediaEncoder.h"
 #include "nsDOMEventTargetHelper.h"
 #include "nsError.h"
 #include "nsIDocument.h"
-#include "nsIDOMBlobEvent.h"
 #include "nsIDOMRecordErrorEvent.h"
 #include "nsTArray.h"
 #include "DOMMediaStream.h"
 #include "EncodedBufferCache.h"
 #include "nsIDOMFile.h"
+#include "mozilla/dom/BlobEvent.h"
 
 namespace mozilla {
 
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED_1(MediaRecorder, nsDOMEventTargetHelper,
                                      mStream)
 
@@ -305,30 +305,24 @@ MediaRecorder::CreateAndDispatchBlobEven
 {
   NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
 
   if (!CheckPrincipal()) {
     // Media is not same-origin, don't allow the data out.
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
-  nsCOMPtr<nsIDOMBlob> blob;
-  blob = mEncodedBufferCache->ExtractBlob(mMimeType);
-
-  // create an event that uses the MessageEvent interface,
-  // which does not bubble, is not cancelable, and has no default action
-  nsCOMPtr<nsIDOMEvent> event;
-  nsresult rv = NS_NewDOMBlobEvent(getter_AddRefs(event), this, nullptr, nullptr);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIDOMBlobEvent> blobEvent = do_QueryInterface(event);
-  rv = blobEvent->InitBlobEvent(NS_LITERAL_STRING("dataavailable"),
-    false, false, blob);
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  BlobEventInitInitializer init;
+  init.mBubbles = false;
+  init.mCancelable = false;
+  init.mData = mEncodedBufferCache->ExtractBlob(mMimeType);
+  nsRefPtr<BlobEvent> event =
+    BlobEvent::Constructor(this,
+                           NS_LITERAL_STRING("dataavailable"),
+                           init);
   event->SetTrusted(true);
   return DispatchDOMEvent(nullptr, event, nullptr, nullptr);
 }
 
 void
 MediaRecorder::DispatchSimpleEvent(const nsAString & aStr)
 {
   NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
--- a/content/media/directshow/SourceFilter.cpp
+++ b/content/media/directshow/SourceFilter.cpp
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SourceFilter.h"
 #include "MediaResource.h"
 #include "mozilla/RefPtr.h"
 #include "DirectShowUtils.h"
 #include "MP3FrameParser.h"
 #include "prlog.h"
+#include <algorithm>
 
 using namespace mozilla::media;
 
 namespace mozilla {
 
 // Define to trace what's on...
 //#define DEBUG_SOURCE_TRACE 1
 
--- a/content/svg/content/src/DOMSVGPathSeg.cpp
+++ b/content/svg/content/src/DOMSVGPathSeg.cpp
@@ -34,24 +34,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSeg)
 NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGPathSeg)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGPathSeg)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGPathSeg)
-  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
+NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGPathSeg, AddRef)
+NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGPathSeg, Release)
 
 DOMSVGPathSeg::DOMSVGPathSeg(DOMSVGPathSegList *aList,
                              uint32_t aListIndex,
                              bool aIsAnimValItem)
   : mList(aList)
   , mListIndex(aListIndex)
   , mIsAnimValItem(aIsAnimValItem)
 {
--- a/content/svg/content/src/DOMSVGPathSeg.h
+++ b/content/svg/content/src/DOMSVGPathSeg.h
@@ -10,24 +10,16 @@
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsWrapperCache.h"
 #include "SVGPathSegUtils.h"
 #include "mozilla/dom/SVGPathSegBinding.h"
 
 class nsSVGElement;
 
-// We make DOMSVGPathSeg a pseudo-interface to allow us to QI to it in order to
-// check that the objects that scripts pass to DOMSVGPathSegList methods are
-// our *native* path seg objects.
-//
-// {494A7566-DC26-40C8-9122-52ABD76870C4}
-#define MOZILLA_DOMSVGPATHSEG_IID \
-  { 0x494A7566, 0xDC26, 0x40C8, { 0x91, 0x22, 0x52, 0xAB, 0xD7, 0x68, 0x70, 0xC4 } }
-
 #define MOZ_SVG_LIST_INDEX_BIT_COUNT 31
 
 namespace mozilla {
 
 #define CHECK_ARG_COUNT_IN_SYNC(segType)                                      \
           NS_ABORT_IF_FALSE(ArrayLength(mArgs) ==                             \
             SVGPathSegUtils::ArgCountForType(uint32_t(segType)) ||            \
             uint32_t(segType) == PATHSEG_CLOSEPATH,                           \
@@ -87,23 +79,21 @@ namespace mozilla {
  *
  * See the architecture comment in DOMSVGLength.h (yes, LENGTH) for an overview
  * of the important points regarding how this specific class works.
  *
  * The main differences between this class and DOMSVGLength is that we have
  * sub-classes (it does not), and the "internal counterpart" that we provide a
  * DOM wrapper for is a list of floats, not an instance of an internal class.
  */
-class DOMSVGPathSeg : public nsISupports,
-                      public nsWrapperCache
+class DOMSVGPathSeg : public nsWrapperCache
 {
 public:
-  NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPATHSEG_IID)
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPathSeg)
+  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGPathSeg)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGPathSeg)
 
   /**
    * Unlike the other list classes, we hide our ctor (because no one should be
    * creating instances of this class directly). This factory method in exposed
    * instead to take care of creating instances of the correct sub-class.
    */
   static DOMSVGPathSeg *CreateFor(DOMSVGPathSegList *aList,
                                   uint32_t aListIndex,
@@ -228,18 +218,16 @@ protected:
 
   // Bounds for the following are checked in the ctor, so be sure to update
   // that if you change the capacity of any of the following.
 
   uint32_t mListIndex:MOZ_SVG_LIST_INDEX_BIT_COUNT;
   uint32_t mIsAnimValItem:1; // uint32_t because MSVC won't pack otherwise
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(DOMSVGPathSeg, MOZILLA_DOMSVGPATHSEG_IID)
-
 class DOMSVGPathSegClosePath
   : public DOMSVGPathSeg
 {
 public:
   DOMSVGPathSegClosePath()
     : DOMSVGPathSeg()
   {
   }
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -2574,20 +2574,21 @@ NotifyOffThreadScriptCompletedRunnable::
     MOZ_ASSERT(NS_IsMainThread());
 
     // Note: this unroots mScript so that it is available to be collected by the
     // JS GC. The receiver needs to root the script before performing a call that
     // could GC.
     nsCOMPtr<nsIJSRuntimeService> svc = do_GetService("@mozilla.org/js/xpc/RuntimeService;1");
     NS_ENSURE_TRUE(svc, NS_ERROR_FAILURE);
 
-    JSRuntime *rt;
-    svc->GetRuntime(&rt);
-    NS_ENSURE_TRUE(svc, NS_ERROR_FAILURE);
-    JSScript *script = JS::FinishOffThreadScript(NULL, rt, mToken);
+    JSScript *script;
+    {
+        AutoSafeJSContext cx;
+        script = JS::FinishOffThreadScript(cx, JS_GetRuntime(cx), mToken);
+    }
 
     return mReceiver->OnScriptCompileComplete(script, script ? NS_OK : NS_ERROR_FAILURE);
 }
 
 static void
 OffThreadScriptReceiverCallback(void *aToken, void *aCallbackData)
 {
     // Be careful not to adjust the refcount on the receiver, as this callback
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1095,17 +1095,17 @@ Navigator::GetBattery(ErrorResult& aRv)
 
     mBatteryManager = new battery::BatteryManager();
     mBatteryManager->Init(mWindow);
   }
 
   return mBatteryManager;
 }
 
-nsIDOMMozPowerManager*
+power::PowerManager*
 Navigator::GetMozPower(ErrorResult& aRv)
 {
   if (!mPowerManager) {
     if (!mWindow) {
       aRv.Throw(NS_ERROR_UNEXPECTED);
       return nullptr;
     }
     mPowerManager = PowerManager::CreateInstance(mWindow);
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -194,17 +194,17 @@ public:
   // The XPCOM GetVendor is OK
   // The XPCOM GetVendorSub is OK
   // The XPCOM GetProductSub is OK
   bool CookieEnabled();
   void GetBuildID(nsString& aBuildID, ErrorResult& aRv)
   {
     aRv = GetBuildID(aBuildID);
   }
-  nsIDOMMozPowerManager* GetMozPower(ErrorResult& aRv);
+  power::PowerManager* GetMozPower(ErrorResult& aRv);
   bool JavaEnabled(ErrorResult& aRv);
   bool TaintEnabled()
   {
     return false;
   }
   void AddIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
   void RemoveIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
   already_AddRefed<nsIDOMMozWakeLock> RequestWakeLock(const nsAString &aTopic,
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -153,17 +153,16 @@
 #include "mozilla/dom/indexedDB/IDBKeyRange.h"
 #include "nsIDOMMediaQueryList.h"
 
 #include "nsDOMTouchEvent.h"
 
 #include "nsWrapperCacheInlines.h"
 #include "mozilla/dom/HTMLCollectionBinding.h"
 
-#include "nsIDOMPowerManager.h"
 #include "nsIDOMWakeLock.h"
 #include "nsIDOMMobileMessageManager.h"
 #include "nsIDOMMozSmsMessage.h"
 #include "nsIDOMMozMmsMessage.h"
 #include "nsIDOMSmsFilter.h"
 #include "nsIDOMSmsSegmentInfo.h"
 #include "nsIDOMMozMobileMessageThread.h"
 #include "nsIDOMConnection.h"
@@ -459,19 +458,16 @@ static nsDOMClassInfoData sClassInfoData
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
   NS_DEFINE_CLASSINFO_DATA(File, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(ModalContentWindow, nsWindowSH,
                            DEFAULT_SCRIPTABLE_FLAGS |
                            WINDOW_SCRIPTABLE_FLAGS)
 
-  NS_DEFINE_CLASSINFO_DATA(MozPowerManager, nsDOMGenericSH,
-                           DOM_DEFAULT_SCRIPTABLE_FLAGS)
-
   NS_DEFINE_CLASSINFO_DATA(MozWakeLock, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozMobileMessageManager, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
 
   NS_DEFINE_CLASSINFO_DATA(MozSmsMessage, nsDOMGenericSH,
                            DOM_DEFAULT_SCRIPTABLE_FLAGS)
@@ -1275,20 +1271,16 @@ nsDOMClassInfo::Init()
   DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ModalContentWindow, nsIDOMWindow)
     DOM_CLASSINFO_WINDOW_MAP_ENTRIES
     DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow)
 #ifdef MOZ_WEBSPEECH
     DOM_CLASSINFO_MAP_ENTRY(nsISpeechSynthesisGetter)
 #endif
   DOM_CLASSINFO_MAP_END
 
-  DOM_CLASSINFO_MAP_BEGIN(MozPowerManager, nsIDOMMozPowerManager)
-     DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozPowerManager)
-  DOM_CLASSINFO_MAP_END
-
   DOM_CLASSINFO_MAP_BEGIN(MozWakeLock, nsIDOMMozWakeLock)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozWakeLock)
   DOM_CLASSINFO_MAP_END
 
   DOM_CLASSINFO_MAP_BEGIN(MozMobileMessageManager, nsIDOMMozMobileMessageManager)
      DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozMobileMessageManager)
   DOM_CLASSINFO_MAP_END
 
--- a/dom/base/nsDOMClassInfoClasses.h
+++ b/dom/base/nsDOMClassInfoClasses.h
@@ -83,17 +83,16 @@ DOMCI_CLASS(XPathResult)
 DOMCI_CLASS(Storage)
 
 DOMCI_CLASS(Blob)
 DOMCI_CLASS(File)
 
 // DOM modal content window class, almost identical to Window
 DOMCI_CLASS(ModalContentWindow)
 
-DOMCI_CLASS(MozPowerManager)
 DOMCI_CLASS(MozWakeLock)
 
 DOMCI_CLASS(MozMobileMessageManager)
 DOMCI_CLASS(MozSmsMessage)
 DOMCI_CLASS(MozMmsMessage)
 DOMCI_CLASS(MozSmsFilter)
 DOMCI_CLASS(MozSmsSegmentInfo)
 DOMCI_CLASS(MozMobileMessageThread)
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -8261,49 +8261,54 @@ nsGlobalWindow::GetLocation(nsIDOMLocati
 
   return NS_OK;
 }
 
 void
 nsGlobalWindow::ActivateOrDeactivate(bool aActivate)
 {
   // Set / unset mIsActive on the top level window, which is used for the
-  // :-moz-window-inactive pseudoclass.
+  // :-moz-window-inactive pseudoclass, and its sheet (if any).
   nsCOMPtr<nsIWidget> mainWidget = GetMainWidget();
   if (!mainWidget)
     return;
 
   // Get the top level widget (if the main widget is a sheet, this will
   // be the sheet's top (non-sheet) parent).
   nsCOMPtr<nsIWidget> topLevelWidget = mainWidget->GetSheetWindowParent();
   if (!topLevelWidget) {
     topLevelWidget = mainWidget;
   }
 
-  // Get the top level widget's nsGlobalWindow
-  nsCOMPtr<nsIDOMWindow> topLevelWindow;
-  if (topLevelWidget == mainWidget) {
-    topLevelWindow = static_cast<nsIDOMWindow*>(this);
-  } else {
+  nsCOMPtr<nsPIDOMWindow> piMainWindow(
+    do_QueryInterface(static_cast<nsIDOMWindow*>(this)));
+  piMainWindow->SetActive(aActivate);
+
+  if (mainWidget != topLevelWidget) {
     // This is a workaround for the following problem:
-    // When a window with an open sheet loses focus, only the sheet window
-    // receives the NS_DEACTIVATE event. However, it's not the sheet that
-    // should lose the active styling, but the containing top level window.
+    // When a window with an open sheet gains or loses focus, only the sheet
+    // window receives the NS_ACTIVATE/NS_DEACTIVATE event.  However the
+    // styling of the containing top level window also needs to change.  We
+    // get around this by calling nsPIDOMWindow::SetActive() on both windows.
+
+    // Get the top level widget's nsGlobalWindow
+    nsCOMPtr<nsIDOMWindow> topLevelWindow;
 
     // widgetListener should be a nsXULWindow
     nsIWidgetListener* listener = topLevelWidget->GetWidgetListener();
     if (listener) {
       nsCOMPtr<nsIXULWindow> window = listener->GetXULWindow();
       nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(window));
       topLevelWindow = do_GetInterface(req);
     }
-  }
-  if (topLevelWindow) {
-    nsCOMPtr<nsPIDOMWindow> piWin(do_QueryInterface(topLevelWindow));
-    piWin->SetActive(aActivate);
+
+    if (topLevelWindow) {
+      nsCOMPtr<nsPIDOMWindow> piWin(do_QueryInterface(topLevelWindow));
+      piWin->SetActive(aActivate);
+    }
   }
 }
 
 static bool
 NotifyDocumentTree(nsIDocument* aDocument, void* aData)
 {
   aDocument->EnumerateSubDocuments(NotifyDocumentTree, nullptr);
   aDocument->DocumentStatesChanged(NS_DOCUMENT_STATE_WINDOW_INACTIVE);
--- a/dom/bindings/BindingGen.py
+++ b/dom/bindings/BindingGen.py
@@ -1,32 +1,39 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import os
 import cPickle
 from Configuration import Configuration
-from Codegen import CGBindingRoot, replaceFileIfChanged
+from Codegen import CGBindingRoot, replaceFileIfChanged, CGEventRoot
 from mozbuild.makeutil import Makefile
 from mozbuild.pythonutil import iter_modules_in_path
 from buildconfig import topsrcdir
 
 
-def generate_binding_files(config, outputprefix, srcprefix, webidlfile):
+def generate_binding_files(config, outputprefix, srcprefix, webidlfile,
+                           generatedEventsWebIDLFiles):
     """
     |config| Is the configuration object.
     |outputprefix| is a prefix to use for the header guards and filename.
     """
 
     depsname = ".deps/" + outputprefix + ".pp"
     root = CGBindingRoot(config, outputprefix, webidlfile)
     replaceFileIfChanged(outputprefix + ".h", root.declare())
     replaceFileIfChanged(outputprefix + ".cpp", root.define())
 
+    if webidlfile in generatedEventsWebIDLFiles:
+        eventName = webidlfile[:-len(".webidl")]
+        generatedEvent = CGEventRoot(config, eventName)
+        replaceFileIfChanged(eventName + ".h", generatedEvent.declare())
+        replaceFileIfChanged(eventName + ".cpp", generatedEvent.define())
+
     mk = Makefile()
     # NOTE: it's VERY important that we output dependencies for the FooBinding
     # file here, not for the header or generated cpp file.  These dependencies
     # are used later to properly determine changedDeps and prevent rebuilding
     # too much.  See the comment explaining $(binding_dependency_trackers) in
     # Makefile.in.
     rule = mk.create_rule([outputprefix])
     rule.add_dependencies(os.path.join(srcprefix, x) for x in root.deps())
@@ -54,17 +61,18 @@ def main():
     def readFile(f):
         file = open(f, 'rb')
         try:
             contents = file.read()
         finally:
             file.close()
         return contents
     allWebIDLFiles = readFile(args[2]).split()
-    changedDeps = readFile(args[3]).split()
+    generatedEventsWebIDLFiles = readFile(args[3]).split()
+    changedDeps = readFile(args[4]).split()
 
     if all(f.endswith("Binding") or f == "ParserResults.pkl" for f in changedDeps):
         toRegenerate = filter(lambda f: f.endswith("Binding"), changedDeps)
         if len(toRegenerate) == 0 and len(changedDeps) == 1:
             # Work around build system bug 874923: if we get here that means
             # that changedDeps contained only one entry and it was
             # "ParserResults.pkl".  That should never happen: if the
             # ParserResults.pkl changes then either one of the globalgen files
@@ -78,12 +86,13 @@ def main():
             toRegenerate = map(lambda f: f[:-len("Binding")] + ".webidl",
                                toRegenerate)
     else:
         toRegenerate = allWebIDLFiles
 
     for webIDLFile in toRegenerate:
         assert webIDLFile.endswith(".webidl")
         outputPrefix = webIDLFile[:-len(".webidl")] + "Binding"
-        generate_binding_files(config, outputPrefix, srcPrefix, webIDLFile);
+        generate_binding_files(config, outputPrefix, srcPrefix, webIDLFile,
+                               generatedEventsWebIDLFiles);
 
 if __name__ == '__main__':
     main()
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -1787,17 +1787,19 @@ GlobalObject::GlobalObject(JSContext* aC
   }
 
   mGlobalJSObject = JS_GetGlobalForObject(aCx, obj);
 }
 
 nsISupports*
 GlobalObject::GetAsSupports() const
 {
-  MOZ_ASSERT(NS_IsMainThread());
+  if (!NS_IsMainThread()) {
+    return nullptr;
+  }
 
   if (mGlobalObject) {
     return mGlobalObject;
   }
 
   JS::Rooted<JS::Value> val(mCx, JS::ObjectValue(*mGlobalJSObject));
 
   // Switch this to UnwrapDOMObjectToISupports once our global objects are
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -1390,17 +1390,17 @@ WantsQueryInterface
   }
 };
 template <class T>
 struct
 WantsQueryInterface<T, true>
 {
   static bool Enabled(JSContext* aCx, JSObject* aGlobal)
   {
-    return IsChromeOrXBL(aCx, aGlobal);
+    return NS_IsMainThread() && IsChromeOrXBL(aCx, aGlobal);
   }
 };
 
 bool
 ThrowingConstructor(JSContext* cx, unsigned argc, JS::Value* vp);
 
 // vp is allowed to be null; in that case no get will be attempted,
 // and *found will simply indicate whether the property exists.
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -771,25 +771,29 @@ DOMInterfaces = {
 'MozCellBroadcast': {
     'nativeType': 'mozilla::dom::CellBroadcast',
 },
 
 'MozNamedAttrMap': {
     'nativeType': 'nsDOMAttributeMap',
 },
 
-'MozTimeManager': {
-    'nativeType': 'mozilla::dom::time::TimeManager',
+'MozPowerManager': {
+    'nativeType': 'mozilla::dom::power::PowerManager',
 },
 
 'MozStkCommandEvent' : {
     'nativeType': 'mozilla::dom::icc::StkCommandEvent',
     'headerFile': 'StkCommandEvent.h',
 },
 
+'MozTimeManager': {
+    'nativeType': 'mozilla::dom::time::TimeManager',
+},
+
 'MozVoicemail': {
     'nativeType': 'mozilla::dom::Voicemail',
 },
 
 'MutationEvent': {
     'nativeType': 'nsDOMMutationEvent',
 },
 
@@ -1794,27 +1798,27 @@ addExternalIface('MozConnection', header
 addExternalIface('MozControllers', nativeType='nsIControllers')
 addExternalIface('MozFrameLoader', nativeType='nsIFrameLoader', notflattened=True)
 addExternalIface('MozIccManager', headerFile='nsIDOMIccManager.h')
 addExternalIface('MozMediaStreamOptions', nativeType='nsIMediaStreamOptions',
                  headerFile='nsIDOMNavigatorUserMedia.h')
 addExternalIface('MozMobileConnection', headerFile='nsIDOMMobileConnection.h')
 addExternalIface('MozMobileMessageManager', headerFile='nsIDOMMobileMessageManager.h')
 addExternalIface('MozObserver', nativeType='nsIObserver', notflattened=True)
-addExternalIface('MozPowerManager', headerFile='nsIDOMPowerManager.h')
 addExternalIface('MozRDFCompositeDataSource', nativeType='nsIRDFCompositeDataSource',
                  notflattened=True)
 addExternalIface('MozRDFResource', nativeType='nsIRDFResource', notflattened=True)
 addExternalIface('MozTelephony', nativeType='nsIDOMTelephony')
 addExternalIface('MozTreeBoxObject', nativeType='nsITreeBoxObject',
                  notflattened=True)
 addExternalIface('MozTreeColumn', nativeType='nsITreeColumn',
                  headerFile='nsITreeColumns.h')
 addExternalIface('MozVoicemailStatus')
 addExternalIface('MozWakeLock', headerFile='nsIDOMWakeLock.h')
+addExternalIface('MozWakeLockListener', headerFile='nsIDOMWakeLockListener.h')
 addExternalIface('MozXULTemplateBuilder', nativeType='nsIXULTemplateBuilder')
 addExternalIface('nsIControllers', nativeType='nsIControllers')
 addExternalIface('nsIInputStreamCallback', nativeType='nsIInputStreamCallback',
                  headerFile='nsIAsyncInputStream.h')
 addExternalIface('nsIStreamListener', nativeType='nsIStreamListener', notflattened=True)
 addExternalIface('nsISupports', nativeType='nsISupports')
 addExternalIface('nsIEditor', nativeType='nsIEditor', notflattened=True)
 addExternalIface('nsIVariant', nativeType='nsIVariant', notflattened=True)
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -9284,17 +9284,17 @@ class CGExampleSetter(CGNativeMember):
                                                                  setter=True))
     def define(self, cgClass):
         return ''
 
 class CGBindingImplClass(CGClass):
     """
     Common codegen for generating a C++ implementation of a WebIDL interface
     """
-    def __init__(self, descriptor, cgMethod, cgGetter, cgSetter):
+    def __init__(self, descriptor, cgMethod, cgGetter, cgSetter, wantGetParent=True):
         """
         cgMethod, cgGetter and cgSetter are classes used to codegen methods,
         getters and setters.
         """
         self.descriptor = descriptor
         self._deps = descriptor.interface.getDeps()
 
         iface = descriptor.interface
@@ -9399,22 +9399,23 @@ class CGBindingImplClass(CGClass):
         wrapArgs = [Argument('JSContext*', 'aCx'),
                     Argument('JS::Handle<JSObject*>', 'aScope')]
         self.methodDecls.insert(0,
                                 ClassMethod("WrapObject", "JSObject*",
                                             wrapArgs, virtual=descriptor.wrapperCache,
                                             breakAfterReturnDecl=" ",
                                             override=descriptor.wrapperCache,
                                             body=self.getWrapObjectBody()))
-        self.methodDecls.insert(0,
-                                ClassMethod("GetParentObject",
-                                            self.getGetParentObjectReturnType(),
-                                            [], const=True,
-                                            breakAfterReturnDecl=" ",
-                                            body=self.getGetParentObjectBody()))
+        if wantGetParent:
+            self.methodDecls.insert(0,
+                                    ClassMethod("GetParentObject",
+                                                self.getGetParentObjectReturnType(),
+                                                [], const=True,
+                                                breakAfterReturnDecl=" ",
+                                                body=self.getGetParentObjectBody()))
 
         # Invoke  CGClass.__init__ in any subclasses afterwards to do the actual codegen.
 
     def getWrapObjectBody(self):
         return None
 
     def getGetParentObjectReturnType(self):
         return ("// TODO: return something sensible here, and change the return type\n"
@@ -10602,8 +10603,375 @@ struct PrototypeTraits;
         curr = CGHeaders([], [], [], [], headers, [], 'UnionConversions', curr)
 
         # Add include guards.
         curr = CGIncludeGuard('UnionConversions', curr)
 
         # Done.
         return curr
 
+# Code generator for simple events
+
+class CGEventGetter(CGNativeMember):
+    def __init__(self, descriptor, attr):
+        ea = descriptor.getExtendedAttributes(attr, getter=True)
+        ea.append('resultNotAddRefed')
+        CGNativeMember.__init__(self, descriptor, attr,
+                                CGSpecializedGetter.makeNativeName(descriptor,
+                                                                   attr),
+                                (attr.type, []),
+                                ea)
+
+    def retval(self, type):
+        if type.isPrimitive() and type.tag() in builtinNames:
+            result = CGGeneric(builtinNames[type.tag()])
+            if type.nullable():
+                result = CGTemplatedType("Nullable", result)
+            return result.define()
+        if type.isDOMString():
+            return "void"
+        if type.isByteString():
+            return "void"
+        if type.isEnum():
+            enumName = type.unroll().inner.identifier.name
+            if type.nullable():
+                enumName = CGTemplatedType("Nullable",
+                                           CGGeneric(enumName)).define()
+            return enumName
+        if type.isGeckoInterface():
+            iface = type.unroll().inner;
+            nativeType = self.descriptorProvider.getDescriptor(
+                iface.identifier.name).nativeType
+            # Now trim off unnecessary namespaces
+            nativeType = nativeType.split("::")
+            if nativeType[0] == "mozilla":
+                nativeType.pop(0)
+                if nativeType[0] == "dom":
+                    nativeType.pop(0)
+            return CGWrapper(CGGeneric("::".join(nativeType)), post="*").define()
+        if type.isAny():
+            return "JS::Value"
+        if type.isObject():
+            return "JSObject*"
+        if type.isSpiderMonkeyInterface():
+            return "JSObject*"
+        raise TypeError("Don't know how to declare return value for %s" %
+                        type)
+
+    def getArgs(self, returnType, argList):
+        args = [self.getArg(arg) for arg in argList]
+        if returnType.isDOMString():
+            args.append(Argument("nsString&", "aRetVal"))
+        elif returnType.isByteString():
+            args.append(Argument("nsCString&", "aRetVal"))
+        if needCx(returnType, argList, self.extendedAttrs,
+                  self.descriptorProvider, True):
+            args.insert(0, Argument("JSContext*", "aCx"))
+        if not 'infallible' in self.extendedAttrs:
+            raise TypeError("Event code generator does not support [Throws]!")
+        return args
+
+    def getMethodBody(self):
+        type = self.member.type
+        memberName = CGDictionary.makeMemberName(self.member.identifier.name)
+        if (type.isPrimitive() and type.tag() in builtinNames) or type.isEnum() or type.isGeckoInterface():
+            return "  return " + memberName + ";"
+        if type.isDOMString() or type.isByteString():
+            return "  aRetVal = " + memberName + ";";
+        if type.isSpiderMonkeyInterface() or type.isObject():
+            ret =  "  if (%s) {\n" % memberName
+            ret += "    JS::ExposeObjectToActiveJS(%s);\n" % memberName
+            ret += "  }\n"
+            ret += "  return " + memberName + ";"
+            return ret;
+        if type.isAny():
+            ret =  "  JS::ExposeValueToActiveJS("+ memberName + ");\n"
+            ret += "  return " + memberName + ";"
+            return ret;
+        raise TypeError("Event code generator does not support this type!")
+
+    def define(self, cgClass):
+        ret = self.retval(self.member.type);
+        methodName = self.descriptorProvider.name + '::' + self.name
+        args = (', '.join([a.declare() for a in self.args]))
+        body = self.getMethodBody()
+        return ret + "\n" + methodName + '(' + args + ') const\n{\n' + body + "\n}\n"
+
+class CGEventSetter(CGNativeMember):
+    def __init__(self):
+        raise TypeError("Event code generator does not support setters!")
+
+class CGEventMethod(CGNativeMember):
+    def __init__(self, descriptor, method, signature, isConstructor, breakAfter=True):
+        if not isConstructor:
+            raise TypeError("Event code generator does not support methods!")
+        self.wantsConstructorForNativeCaller = True
+        CGNativeMember.__init__(self, descriptor, method,
+                                CGSpecializedMethod.makeNativeName(descriptor,
+                                                                   method),
+                                signature,
+                                descriptor.getExtendedAttributes(method),
+                                breakAfter=breakAfter,
+                                variadicIsSequence=True)
+        self.originalArgs = list(self.args)
+
+    def getArgs(self, returnType, argList):
+        args = [self.getArg(arg) for arg in argList]
+        return args
+
+    def getArg(self, arg):
+        (decl, ref) = self.getArgType(arg.type,
+                                      arg.optional and not arg.defaultValue,
+                                      "Variadic" if arg.variadic else False)
+        if ref:
+            decl = CGWrapper(decl, pre="const ", post="&")
+
+        name = arg.identifier.name
+        name = "a" + name[0].upper() + name[1:]
+        return Argument(decl.define(), name)
+
+    def declare(self, cgClass):
+        self.args = list(self.originalArgs)
+        self.args.insert(0, Argument("mozilla::dom::EventTarget*", "aOwner"))
+        constructorForNativeCaller = CGNativeMember.declare(self, cgClass) + "\n"
+        self.args = list(self.originalArgs)
+        if needCx(None, self.descriptorProvider.interface.members, [], self.descriptorProvider, True):
+            self.args.insert(0, Argument("JSContext*", "aCx"))
+        self.args.insert(0, Argument("const GlobalObject&", "aGlobal"))
+        self.args.append(Argument('ErrorResult&', 'aRv'))
+        return constructorForNativeCaller + CGNativeMember.declare(self, cgClass)
+
+    def define(self, cgClass):
+        self.args = list(self.originalArgs)
+        members = ""
+        holdJS = ""
+        for m in self.descriptorProvider.interface.members:
+            if m.isAttr():
+                name = CGDictionary.makeMemberName(m.identifier.name)
+                members += "e->%s = %s.%s;\n" % (name, self.args[1].name, name)
+                if m.type.isAny() or m.type.isObject() or m.type.isSpiderMonkeyInterface():
+                    holdJS = "mozilla::HoldJSObjects(e.get());\n"
+
+        self.body = (
+            "nsRefPtr<${nativeType}> e = new ${nativeType}(aOwner);\n"
+            "bool trusted = e->Init(aOwner);\n"
+            "e->InitEvent(${eventType}, ${eventInit}.mBubbles, ${eventInit}.mCancelable);\n"
+            "${members}"
+            "e->SetTrusted(trusted);\n"
+            "${holdJS}"
+            "return e.forget();"
+            )
+        self.body = string.Template(self.body).substitute(
+            {
+              "nativeType": self.descriptorProvider.nativeType.split('::')[-1],
+              "eventType": self.args[0].name,
+              "eventInit": self.args[1].name,
+              "members": members,
+              "holdJS": holdJS
+            })
+
+        self.args.insert(0, Argument("mozilla::dom::EventTarget*", "aOwner"))
+        constructorForNativeCaller = CGNativeMember.define(self, cgClass) + "\n"
+        self.args = list(self.originalArgs)
+        self.body = (
+            "nsCOMPtr<mozilla::dom::EventTarget> owner = do_QueryInterface(aGlobal.GetAsSupports());\n"
+            "return Constructor(owner, %s, %s);" % (self.args[0].name, self.args[1].name)
+            )
+        if needCx(None, self.descriptorProvider.interface.members, [], self.descriptorProvider, True):
+            self.args.insert(0, Argument("JSContext*", "aCx"))
+        self.args.insert(0, Argument("const GlobalObject&", "aGlobal"))
+        self.args.append(Argument('ErrorResult&', 'aRv'))
+        return constructorForNativeCaller + CGNativeMember.define(self, cgClass)
+
+class CGEventClass(CGBindingImplClass):
+    """
+    Codegen for the actual Event class implementation for this descriptor
+    """
+    def __init__(self, descriptor):
+        CGBindingImplClass.__init__(self, descriptor, CGEventMethod, CGEventGetter, CGEventSetter, False)
+        members = []
+        for m in descriptor.interface.members:
+            if m.isAttr():
+                if m.type.isPrimitive() and m.type.tag() in builtinNames:
+                    nativeType = CGGeneric(builtinNames[m.type.tag()])
+                    if m.type.nullable():
+                        nativeType = CGTemplatedType("Nullable", nativeType)
+                    nativeType = nativeType.define()
+                elif m.type.isEnum():
+                    nativeType = m.type.unroll().inner.identifier.name
+                    if m.type.nullable():
+                        nativeType = CGTemplatedType("Nullable",
+                                                     CGGeneric(nativeType)).define()
+                elif m.type.isDOMString():
+                    nativeType = "nsString"
+                elif m.type.isByteString():
+                    nativeType = "nsCString"
+                elif m.type.isGeckoInterface():
+                    iface = m.type.unroll().inner;
+                    nativeType = self.descriptor.getDescriptor(
+                        iface.identifier.name).nativeType
+                    # Now trim off unnecessary namespaces
+                    nativeType = nativeType.split("::")
+                    if nativeType[0] == "mozilla":
+                        nativeType.pop(0)
+                        if nativeType[0] == "dom":
+                            nativeType.pop(0)
+                    nativeType = CGWrapper(CGGeneric("::".join(nativeType)), pre="nsRefPtr<", post=">").define()
+                elif m.type.isAny():
+                    nativeType = "JS::Heap<JS::Value>"
+                elif m.type.isObject() or m.type.isSpiderMonkeyInterface():
+                    nativeType = "JS::Heap<JSObject*>"
+                members.append(ClassMember(CGDictionary.makeMemberName(m.identifier.name),
+                               nativeType,
+                               visibility="private",
+                               body="body"))
+
+        baseDeclarations=(
+            "public:\n"
+            "  NS_DECL_ISUPPORTS_INHERITED\n"
+            "  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(${nativeType}, nsDOMEvent)\n"
+            "  virtual ~${nativeType}();\n"
+            "protected:\n"
+            "  ${nativeType}(mozilla::dom::EventTarget* aOwner);\n\n")
+
+        baseDeclarations = string.Template(baseDeclarations).substitute(
+            {
+              "nativeType": self.descriptor.nativeType.split('::')[-1]
+            })
+
+        CGClass.__init__(self, descriptor.nativeType.split('::')[-1],
+                         bases=[ClassBase("nsDOMEvent")],
+                         methods=self.methodDecls,
+                         members=members,
+                         extradeclarations=baseDeclarations)
+
+    def getWrapObjectBody(self):
+        return "return %sBinding::Wrap(aCx, aScope, this);" % self.descriptor.name
+
+    def implTraverse(self):
+        retVal = ""
+        for m in self.descriptor.interface.members:
+            if m.isAttr() and m.type.isGeckoInterface():
+                retVal += ("  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(" +
+                           CGDictionary.makeMemberName(m.identifier.name) +
+                          ")\n")
+        return retVal
+
+    def implUnlink(self):
+        retVal = ""
+        for m in self.descriptor.interface.members:
+            if m.isAttr():
+                name = CGDictionary.makeMemberName(m.identifier.name)
+                if m.type.isGeckoInterface():
+                    retVal += "  NS_IMPL_CYCLE_COLLECTION_UNLINK(" + name + ")\n"
+                elif m.type.isAny():
+                    retVal += "  tmp->" + name + ".setUndefined();\n"
+                elif m.type.isObject() or m.type.isSpiderMonkeyInterface():
+                    retVal += "  tmp->" + name + " = nullptr;\n"
+        return retVal
+
+    def implTrace(self):
+        retVal = ""
+        for m in self.descriptor.interface.members:
+            if m.isAttr():
+                name = CGDictionary.makeMemberName(m.identifier.name)
+                if m.type.isAny():
+                    retVal += "  NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(" + name + ")\n"
+                elif m.type.isObject() or m.type.isSpiderMonkeyInterface():
+                    retVal += "  NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(" + name + ")\n"
+        return retVal
+
+    def define(self):
+        dropJS = ""
+        for m in self.descriptor.interface.members:
+            if m.isAttr():
+                member = CGDictionary.makeMemberName(m.identifier.name);
+                if m.type.isAny():
+                    dropJS += "  " + member + " = JS::UndefinedValue();\n"
+                elif m.type.isObject() or m.type.isSpiderMonkeyInterface():
+                    dropJS += "  " + member + " = nullptr;\n"
+        if dropJS != "":
+            dropJS += "  mozilla::DropJSObjects(this);\n"
+        # Just override CGClass and do our own thing
+        classImpl = """
+NS_IMPL_CYCLE_COLLECTION_CLASS(${nativeType})
+
+NS_IMPL_ADDREF_INHERITED(${nativeType}, nsDOMEvent)
+NS_IMPL_RELEASE_INHERITED(${nativeType}, nsDOMEvent)
+
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(${nativeType}, nsDOMEvent)
+${traverse}NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+
+NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(${nativeType}, nsDOMEvent)
+${trace}NS_IMPL_CYCLE_COLLECTION_TRACE_END
+
+NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(${nativeType}, nsDOMEvent)
+${unlink}NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(${nativeType})
+NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
+
+${nativeType}::${nativeType}(mozilla::dom::EventTarget* aOwner)
+  : nsDOMEvent(aOwner, nullptr, nullptr)
+{
+}
+
+${nativeType}::~${nativeType}()
+{
+${dropJS}}
+
+"""
+        return string.Template(classImpl).substitute(
+            { "ifaceName": self.descriptor.name,
+              "nativeType": self.descriptor.nativeType.split('::')[-1],
+              "traverse": self.implTraverse(),
+              "unlink": self.implUnlink(),
+              "trace": self.implTrace(),
+              "dropJS": dropJS}
+            ) + CGBindingImplClass.define(self)
+
+
+class CGEventRoot(CGThing):
+    def __init__(self, config, interfaceName):
+        # Let's assume we're not doing workers stuff, for now
+        descriptor = config.getDescriptor(interfaceName, False)
+
+        self.root = CGWrapper(CGEventClass(descriptor),
+                              pre="\n", post="\n")
+
+        self.root = CGNamespace.build(["mozilla", "dom"], self.root)
+
+        self.root = CGList([CGClassForwardDeclare("JSContext", isStruct=True),
+                            self.root], "\n")
+
+        # Throw in our #includes
+        self.root = CGHeaders([descriptor], [], [], [],
+                              [ "nsDOMEvent.h",
+                                "mozilla/Attributes.h",
+                                "mozilla/ErrorResult.h" ,
+                                "mozilla/dom/%sBinding.h" % interfaceName,
+                                'mozilla/dom/BindingUtils.h',
+                              ],
+                              [ "%s.h" % interfaceName,
+                                "js/GCAPI.h",
+                                'mozilla/dom/Nullable.h',
+                                'nsDOMQS.h'
+                              ], "", self.root);
+
+        # And now some include guards
+        self.root = CGIncludeGuard(interfaceName, self.root)
+
+        self.root = CGWrapper(self.root, pre=AUTOGENERATED_WARNING_COMMENT)
+
+        self.root = CGWrapper(self.root, pre="""/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim:set ts=2 sw=2 sts=2 et cindent: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+""")
+
+    def declare(self):
+        return self.root.declare()
+
+    def define(self):
+        return self.root.define()
+
--- a/dom/bindings/Makefile.in
+++ b/dom/bindings/Makefile.in
@@ -7,21 +7,26 @@ EXPORT_LIBRARY   = 1
 # Need this to find all our DOM source files.
 include $(topsrcdir)/dom/dom-config.mk
 
 webidl_base = $(topsrcdir)/dom/webidl
 # Generated by moz.build
 include webidlsrcs.mk
 
 binding_include_path := mozilla/dom
+webidl_files += $(generated_events_webidl_files)
 all_webidl_files = $(webidl_files) $(generated_webidl_files) $(preprocessed_webidl_files)
+
 # Set exported_binding_headers before adding the test IDL to the mix
 exported_binding_headers := $(subst .webidl,Binding.h,$(all_webidl_files))
+exported_generated_events_headers := $(subst .webidl,.h,$(generated_events_webidl_files))
+
 # Set linked_binding_cpp_files before adding the test IDL to the mix
 linked_binding_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files))
+linked_generated_events_cpp_files := $(subst .webidl,.cpp,$(generated_events_webidl_files))
 
 all_webidl_files += $(test_webidl_files)
 
 binding_header_files := $(subst .webidl,Binding.h,$(all_webidl_files))
 binding_cpp_files := $(subst .webidl,Binding.cpp,$(all_webidl_files))
 
 # We want to be able to only regenerate the .cpp and .h files that really need
 # to change when a .webidl file changes.  We do this by making the
@@ -51,16 +56,17 @@ globalgen_targets := \
 #
 # XXXbz We could try to cheat even more and only include our CPPSRCS
 # when $(MAKECMDGOALS) contains libs, so that we can skip loading all
 # those .o.pp when trying to make a single .cpp file too, but that
 # would break |make FooBinding.o(bj)|.  Ah, well.
 ifneq (export TestExampleInterface-example TestExampleProxyInterface-example,$(MAKECMDGOALS))
 CPPSRCS = \
   $(linked_binding_cpp_files) \
+  $(linked_generated_events_cpp_files) \
   $(filter %.cpp, $(globalgen_targets)) \
   BindingUtils.cpp \
   CallbackInterface.cpp \
   CallbackObject.cpp \
   DOMJSProxyHandler.cpp \
   Date.cpp \
   Exceptions.cpp \
   $(NULL)
@@ -92,17 +98,17 @@ endif
 ifdef MOZ_B2G_RIL
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/icc/src \
   $(NULL)
 endif
 
 EXTRA_EXPORT_MDDEPEND_FILES := $(addsuffix .pp,$(binding_dependency_trackers))
 
-EXPORTS_GENERATED_FILES := $(exported_binding_headers)
+EXPORTS_GENERATED_FILES := $(exported_binding_headers) $(exported_generated_events_headers)
 EXPORTS_GENERATED_DEST := $(DIST)/include/$(binding_include_path)
 EXPORTS_GENERATED_TARGET := export
 INSTALL_TARGETS += EXPORTS_GENERATED
 
 # Install auto-generated GlobalGen files. The rules for the install must
 # be in the same target/subtier as GlobalGen.py, otherwise the files will not
 # get installed into the appropriate location as they are generated.
 globalgen_headers_FILES := \
@@ -224,33 +230,36 @@ ParserResults.pkl: $(globalgen_dependenc
 # Next, BindingGen.py will examine the changed dependency list to figure out
 # what it really needs to regenerate.
 # Finally, touch the .BindingGen file so that we don't have to keep redoing
 # all that until something else actually changes.
 .BindingGen: $(bindinggen_dependencies) $(binding_dependency_trackers)
 	$(info Generating WebIDL bindings)
 	$(MKDIR) -p .deps
 	echo $(all_webidl_files) > .all-webidl-file-list
+	echo $(generated_events_webidl_files) > .generated-events-webidl-files
 	echo $? > .changed-dependency-list
 	PYTHONDONTWRITEBYTECODE=1 $(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  $(PLY_INCLUDE) -I$(srcdir)/parser \
 	  $(srcdir)/BindingGen.py \
 	  $(srcdir)/Bindings.conf \
 	  $(CURDIR) \
 	  .all-webidl-file-list \
+	  .generated-events-webidl-files \
 	  .changed-dependency-list
 	@$(TOUCH) $@
 
 GARBAGE += \
   webidlyacc.py \
   parser.out \
   $(wildcard *-example.h) \
   $(wildcard *-example.cpp) \
   .BindingGen \
   .all-webidl-file-list \
+  .generated-events-webidl-files \
   .changed-dependency-list \
   $(binding_dependency_trackers) \
   $(NULL)
 
 # Make sure all binding header files are created during the export stage, so we
 # don't have issues with .cpp files being compiled before we've generated the
 # headers they depend on.  This is really only needed for the test files, since
 # the non-test headers are all exported above anyway.  Note that this means that
--- a/dom/interfaces/base/domstubs.idl
+++ b/dom/interfaces/base/domstubs.idl
@@ -80,10 +80,9 @@ interface nsIDOMCRMFObject;
 interface nsIDOMCrypto;
 interface nsIDOMPkcs11;
 
 // Used font face (for inspector)
 interface nsIDOMFontFace;
 interface nsIDOMFontFaceList;
 
 // Power
-interface nsIDOMMozPowerManager;
 interface nsIDOMMozWakeLock;
--- a/dom/interfaces/events/moz.build
+++ b/dom/interfaces/events/moz.build
@@ -2,17 +2,16 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 XPIDL_SOURCES += [
     'nsIDOMAnimationEvent.idl',
     'nsIDOMBeforeUnloadEvent.idl',
-    'nsIDOMBlobEvent.idl',
     'nsIDOMClipboardEvent.idl',
     'nsIDOMCloseEvent.idl',
     'nsIDOMCommandEvent.idl',
     'nsIDOMCompositionEvent.idl',
     'nsIDOMCustomEvent.idl',
     'nsIDOMDOMTransactionEvent.idl',
     'nsIDOMDataContainerEvent.idl',
     'nsIDOMDataTransfer.idl',
deleted file mode 100644
--- a/dom/interfaces/events/nsIDOMBlobEvent.idl
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIDOMEvent.idl"
-interface nsIDOMBlob;
-/**
- * The nsIDOMBlobEvent interface is used for server-sent events
- *
- * For more information on this interface, please see
- * https://dvcs.w3.org/hg/dap/raw-file/tip/media-stream-capture/RecordingProposal.html
- */
-[scriptable, builtinclass, uuid(84293ee0-68f5-11e2-9906-cf63ba8c6e43)]
-interface nsIDOMBlobEvent : nsIDOMEvent
-{
-  /**
-   * Custom blob data associated with this event.
-   */
-  readonly attribute nsIDOMBlob data;
-  
-  [noscript]
-  void initBlobEvent(in DOMString aType,
-                     in boolean aCanBubble,
-                     in boolean aCancelable,
-                     in nsIDOMBlob aData);
-};
-
-dictionary BlobEventInit : EventInit {
-  nsIDOMBlob data;
-};
--- a/dom/permission/tests/test_power.html
+++ b/dom/permission/tests/test_power.html
@@ -15,16 +15,16 @@ https://bugzilla.mozilla.org/show_bug.cg
 <div id="content" style="display: none"></div>
 <pre id="test">
 <script type="application/javascript;version=1.8" src="file_framework.js"></script>
 <script type="application/javascript;version=1.8">
 var gData = [
   {
     perm: ["power"],
     obj: "mozPower",
-    idl: "nsIDOMMozPowerManager",
+    webidl: "MozPowerManager",
   },
 ]
 </script>
 </pre>
 </body>
 </html>
 
--- a/dom/power/PowerManager.cpp
+++ b/dom/power/PowerManager.cpp
@@ -10,39 +10,43 @@
 #include "nsIDOMWakeLockListener.h"
 #include "nsIDocument.h"
 #include "nsIPermissionManager.h"
 #include "nsIPowerManagerService.h"
 #include "nsIPrincipal.h"
 #include "nsPIDOMWindow.h"
 #include "nsServiceManagerUtils.h"
 #include "nsError.h"
-
-DOMCI_DATA(MozPowerManager, mozilla::dom::power::PowerManager)
+#include "mozilla/dom/MozPowerManagerBinding.h"
 
 namespace mozilla {
 namespace dom {
 namespace power {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PowerManager)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMMozPowerManager)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMMozPowerManager)
+  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
+  NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozWakeLockListener)
-  NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozPowerManager)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTION_1(PowerManager, mListeners)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(PowerManager, mListeners, mWindow)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(PowerManager)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(PowerManager)
 
+/* virtual */ JSObject*
+PowerManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
+{
+  return MozPowerManagerBinding::Wrap(aCx, aScope, this);
+}
+
 nsresult
 PowerManager::Init(nsIDOMWindow *aWindow)
 {
-  mWindow = do_GetWeakReference(aWindow);
+  mWindow = aWindow;
 
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
   NS_ENSURE_STATE(pmService);
 
   // Add ourself to the global notification list.
   pmService->AddWakeLockListener(this);
   return NS_OK;
@@ -55,73 +59,72 @@ PowerManager::Shutdown()
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
   NS_ENSURE_STATE(pmService);
 
   // Remove ourself from the global notification list.
   pmService->RemoveWakeLockListener(this);
   return NS_OK;
 }
 
-NS_IMETHODIMP
-PowerManager::Reboot()
+void
+PowerManager::Reboot(ErrorResult& aRv)
 {
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
-  NS_ENSURE_STATE(pmService);
-
-  pmService->Reboot();
-
-  return NS_OK;
+  if (pmService) {
+    pmService->Reboot();
+  } else {
+    aRv.Throw(NS_ERROR_UNEXPECTED);
+  }
 }
 
-NS_IMETHODIMP
+void
 PowerManager::FactoryReset()
 {
   hal::FactoryReset();
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-PowerManager::PowerOff()
+void
+PowerManager::PowerOff(ErrorResult& aRv)
 {
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
-  NS_ENSURE_STATE(pmService);
-
-  pmService->PowerOff();
-
-  return NS_OK;
+  if (pmService) {
+    pmService->PowerOff();
+  } else {
+    aRv.Throw(NS_ERROR_UNEXPECTED);
+  }
 }
 
-NS_IMETHODIMP
+void
 PowerManager::AddWakeLockListener(nsIDOMMozWakeLockListener *aListener)
 {
-  // already added? bail out.
-  if (mListeners.Contains(aListener))
-    return NS_OK;
-
-  mListeners.AppendElement(aListener);
-  return NS_OK;
+  if (!mListeners.Contains(aListener)) {
+    mListeners.AppendElement(aListener);
+  }
 }
 
-NS_IMETHODIMP
+void
 PowerManager::RemoveWakeLockListener(nsIDOMMozWakeLockListener *aListener)
 {
   mListeners.RemoveElement(aListener);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-PowerManager::GetWakeLockState(const nsAString &aTopic, nsAString &aState)
+void
+PowerManager::GetWakeLockState(const nsAString& aTopic,
+                               nsAString& aState,
+                               ErrorResult& aRv)
 {
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
-  NS_ENSURE_STATE(pmService);
-
-  return pmService->GetWakeLockState(aTopic, aState);
+  if (pmService) {
+    aRv = pmService->GetWakeLockState(aTopic, aState);
+  } else {
+    aRv.Throw(NS_ERROR_UNEXPECTED);
+  }
 }
 
 NS_IMETHODIMP
 PowerManager::Callback(const nsAString &aTopic, const nsAString &aState)
 {
   /**
    * We maintain a local listener list instead of using the global
    * list so that when the window is destroyed we don't have to
@@ -133,57 +136,54 @@ PowerManager::Callback(const nsAString &
   nsAutoTArray<nsCOMPtr<nsIDOMMozWakeLockListener>, 2> listeners(mListeners);
   for (uint32_t i = 0; i < listeners.Length(); ++i) {
     listeners[i]->Callback(aTopic, aState);
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-PowerManager::GetScreenEnabled(bool *aEnabled)
+bool
+PowerManager::ScreenEnabled()
 {
-  *aEnabled = hal::GetScreenEnabled();
-  return NS_OK;
+  return hal::GetScreenEnabled();
 }
 
-NS_IMETHODIMP
+void
 PowerManager::SetScreenEnabled(bool aEnabled)
 {
   hal::SetScreenEnabled(aEnabled);
-  return NS_OK;
 }
 
-NS_IMETHODIMP
-PowerManager::GetScreenBrightness(double *aBrightness)
+double
+PowerManager::ScreenBrightness()
 {
-  *aBrightness = hal::GetScreenBrightness();
-  return NS_OK;
+  return hal::GetScreenBrightness();
 }
 
-NS_IMETHODIMP
-PowerManager::SetScreenBrightness(double aBrightness)
+void
+PowerManager::SetScreenBrightness(double aBrightness, ErrorResult& aRv)
 {
-  NS_ENSURE_TRUE(0 <= aBrightness && aBrightness <= 1, NS_ERROR_INVALID_ARG);
-  hal::SetScreenBrightness(aBrightness);
-  return NS_OK;
+  if (0 <= aBrightness && aBrightness <= 1) {
+    hal::SetScreenBrightness(aBrightness);
+  } else {
+    aRv.Throw(NS_ERROR_INVALID_ARG);
+  }
 }
 
-NS_IMETHODIMP
-PowerManager::GetCpuSleepAllowed(bool *aAllowed)
+bool
+PowerManager::CpuSleepAllowed()
 {
-  *aAllowed = hal::GetCpuSleepAllowed();
-  return NS_OK;
+  return hal::GetCpuSleepAllowed();
 }
 
-NS_IMETHODIMP
+void
 PowerManager::SetCpuSleepAllowed(bool aAllowed)
 {
   hal::SetCpuSleepAllowed(aAllowed);
-  return NS_OK;
 }
 
 bool
 PowerManager::CheckPermission(nsPIDOMWindow* aWindow)
 {
   nsCOMPtr<nsIPermissionManager> permMgr =
     do_GetService(NS_PERMISSIONMANAGER_CONTRACTID);
   NS_ENSURE_TRUE(permMgr, false);
--- a/dom/power/PowerManager.h
+++ b/dom/power/PowerManager.h
@@ -2,51 +2,72 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef mozilla_dom_power_PowerManager_h
 #define mozilla_dom_power_PowerManager_h
 
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
-#include "nsIDOMPowerManager.h"
 #include "nsIDOMWakeLockListener.h"
 #include "nsIDOMWindow.h"
 #include "nsWeakReference.h"
 #include "nsCycleCollectionParticipant.h"
+#include "nsWrapperCache.h"
 
 class nsPIDOMWindow;
 
 namespace mozilla {
+class ErrorResult;
+
 namespace dom {
 namespace power {
 
-class PowerManager
-  : public nsIDOMMozPowerManager
-  , public nsIDOMMozWakeLockListener
+class PowerManager MOZ_FINAL : public nsIDOMMozWakeLockListener
+                             , public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(PowerManager, nsIDOMMozPowerManager)
-  NS_DECL_NSIDOMMOZPOWERMANAGER
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PowerManager)
   NS_DECL_NSIDOMMOZWAKELOCKLISTENER
 
-  PowerManager() {};
-  virtual ~PowerManager() {};
+  PowerManager()
+  {
+    SetIsDOMBinding();
+  }
 
   nsresult Init(nsIDOMWindow *aWindow);
   nsresult Shutdown();
 
   static bool CheckPermission(nsPIDOMWindow*);
 
   static already_AddRefed<PowerManager> CreateInstance(nsPIDOMWindow*);
 
-private:
+  // WebIDL
+  nsIDOMWindow* GetParentObject() const
+  {
+    return mWindow;
+  }
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
+  void Reboot(ErrorResult& aRv);
+  void FactoryReset();
+  void PowerOff(ErrorResult& aRv);
+  void AddWakeLockListener(nsIDOMMozWakeLockListener* aListener);
+  void RemoveWakeLockListener(nsIDOMMozWakeLockListener* aListener);
+  void GetWakeLockState(const nsAString& aTopic, nsAString& aState,
+                        ErrorResult& aRv);
+  bool ScreenEnabled();
+  void SetScreenEnabled(bool aEnabled);
+  double ScreenBrightness();
+  void SetScreenBrightness(double aBrightness, ErrorResult& aRv);
+  bool CpuSleepAllowed();
+  void SetCpuSleepAllowed(bool aAllowed);
 
-  nsWeakPtr mWindow;
+private:
+  nsCOMPtr<nsIDOMWindow> mWindow;
   nsTArray<nsCOMPtr<nsIDOMMozWakeLockListener> > mListeners;
 };
 
 } // namespace power
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_power_PowerManager_h
--- a/dom/power/moz.build
+++ b/dom/power/moz.build
@@ -3,25 +3,25 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
-    'nsIDOMPowerManager.idl',
     'nsIDOMWakeLock.idl',
     'nsIDOMWakeLockListener.idl',
     'nsIPowerManagerService.idl',
 ]
 
 XPIDL_MODULE = 'dom_power'
 
 EXPORTS.mozilla.dom.power += [
+    'PowerManager.h',
     'PowerManagerService.h',
     'Types.h',
 ]
 
 CPP_SOURCES += [
     'PowerManager.cpp',
     'PowerManagerService.cpp',
     'WakeLock.cpp',
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -601,17 +601,17 @@ NetworkManager.prototype = {
       cmd: "setDefaultRouteAndDNS",
       ifname: this.active.name,
       oldIfname: (oldInterface && oldInterface != this.active) ? oldInterface.name : null,
       gateway_str: this.active.gateway,
       dns1_str: this.active.dns1,
       dns2_str: this.active.dns2
     };
     this.worker.postMessage(options);
-    this.setNetworkProxy();
+    this.setNetworkProxy(this.active);
   },
 
   removeDefaultRoute: function removeDefaultRoute(ifname) {
     debug("Remove default route for " + ifname);
     let options = {
       cmd: "removeDefaultRoute",
       ifname: ifname
     }
@@ -684,43 +684,43 @@ NetworkManager.prototype = {
       cmd: "removeHostRoute",
       ifname: network.name,
       gateway: network.gateway,
       hostnames: hosts
     };
     this.worker.postMessage(options);
   },
 
-  setNetworkProxy: function setNetworkProxy() {
+  setNetworkProxy: function setNetworkProxy(network) {
     try {
-      if (!this.active.httpProxyHost || this.active.httpProxyHost == "") {
+      if (!network.httpProxyHost || network.httpProxyHost == "") {
         // Sets direct connection to internet.
         Services.prefs.clearUserPref("network.proxy.type");
         Services.prefs.clearUserPref("network.proxy.share_proxy_settings");
         Services.prefs.clearUserPref("network.proxy.http");
         Services.prefs.clearUserPref("network.proxy.http_port");
         Services.prefs.clearUserPref("network.proxy.ssl");
         Services.prefs.clearUserPref("network.proxy.ssl_port");
-        debug("No proxy support for " + this.active.name + " network interface.");
+        debug("No proxy support for " + network.name + " network interface.");
         return;
       }
 
-      debug("Going to set proxy settings for " + this.active.name + " network interface.");
+      debug("Going to set proxy settings for " + network.name + " network interface.");
       // Sets manual proxy configuration.
       Services.prefs.setIntPref("network.proxy.type", MANUAL_PROXY_CONFIGURATION);
       // Do not use this proxy server for all protocols.
       Services.prefs.setBoolPref("network.proxy.share_proxy_settings", false);
-      Services.prefs.setCharPref("network.proxy.http", this.active.httpProxyHost);
-      Services.prefs.setCharPref("network.proxy.ssl", this.active.httpProxyHost);
-      let port = this.active.httpProxyPort == "" ? 8080 : this.active.httpProxyPort;
+      Services.prefs.setCharPref("network.proxy.http", network.httpProxyHost);
+      Services.prefs.setCharPref("network.proxy.ssl", network.httpProxyHost);
+      let port = network.httpProxyPort == 0 ? 8080 : network.httpProxyPort;
       Services.prefs.setIntPref("network.proxy.http_port", port);
       Services.prefs.setIntPref("network.proxy.ssl_port", port);
     } catch (ex) {
        debug("Exception " + ex + ". Unable to set proxy setting for "
-             + this.active.name + " network interface.");
+             + network.name + " network interface.");
        return;
     }
   },
 
   // nsISettingsServiceCallback
 
   tetheringSettings: {},
 
--- a/dom/system/gonk/nsINetworkManager.idl
+++ b/dom/system/gonk/nsINetworkManager.idl
@@ -114,17 +114,17 @@ interface nsIWifiOperationModeCallback :
    *        or `null` if it was.
    */
   void wifiOperationModeResult(in jsval error);
 };
 
 /**
  * Manage network interfaces.
  */
-[scriptable, uuid(5b22c620-f8b9-11e2-b778-0800200c9a66)]
+[scriptable, uuid(fad3fb08-664f-48e3-bba3-423186988c61)]
 interface nsINetworkManager : nsISupports
 {
   /**
    * Register the given network interface with the network manager.
    *
    * Consumers will be notified with the 'network-interface-registered'
    * observer notification.
    *
@@ -226,9 +226,17 @@ interface nsINetworkManager : nsISupport
    *        AP  - Access pointer mode.
    *        P2P - Peer to peer connection mode.
    *        STA - Station mode.
    *
    * @param callback
    *        Callback to notify Wifi firmware reload result.
    */
   void setWifiOperationMode(in DOMString interfaceName, in DOMString mode, in nsIWifiOperationModeCallback callback);
+
+  /**
+   * Set http proxy for specific network
+   *
+   * @param network
+   *        Network interface to register.
+   */
+  void setNetworkProxy(in nsINetworkInterface network);
 };
--- a/dom/webidl/BlobEvent.webidl
+++ b/dom/webidl/BlobEvent.webidl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 interface Blob;
 
-[Constructor(DOMString type, optional BlobEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
+[Constructor(DOMString type, optional BlobEventInit eventInitDict)]
 interface BlobEvent : Event
 {
   readonly attribute Blob? data;
 };
 
 dictionary BlobEventInit : EventInit
 {
   Blob? data = null;
rename from dom/power/nsIDOMPowerManager.idl
rename to dom/webidl/MozPowerManager.webidl
--- a/dom/power/nsIDOMPowerManager.idl
+++ b/dom/webidl/MozPowerManager.webidl
@@ -1,52 +1,52 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsISupports.idl"
-
-interface nsIDOMMozWakeLockListener;
+interface MozWakeLockListener;
 
 /**
  * This interface implements navigator.mozPower
  */
-[scriptable, uuid(7b181fef-2757-4198-89a0-8c426b8439ea)]
-interface nsIDOMMozPowerManager : nsISupports
+interface MozPowerManager
 {
+    [Throws]
     void    powerOff();
+    [Throws]
     void    reboot();
     void    factoryReset();
 
     /**
      * The listeners are notified when a resource changes its lock state to:
      *  - unlocked
      *  - locked but not visible
      *  - locked and visible
      */
-    void    addWakeLockListener(in nsIDOMMozWakeLockListener aListener);
-    void    removeWakeLockListener(in nsIDOMMozWakeLockListener aListener);
+    void    addWakeLockListener(MozWakeLockListener aListener);
+    void    removeWakeLockListener(MozWakeLockListener aListener);
 
     /**
      * Query the wake lock state of the topic.
      *
      * Possible states are:
      *
      *  - "unlocked" - nobody holds the wake lock.
      *
      *  - "locked-foreground" - at least one window holds the wake lock,
      *    and it is visible.
      *
      *  - "locked-background" - at least one window holds the wake lock,
      *    but all of them are hidden.
      *
      * @param aTopic The resource name related to the wake lock.
      */
-    DOMString getWakeLockState(in DOMString aTopic);
+    [Throws]
+    DOMString getWakeLockState(DOMString aTopic);
 
     /**
      * Is the device's screen currently enabled?  This attribute controls the
      * device's screen, so setting it to false will turn off the screen.
      */
     attribute boolean screenEnabled;
 
     /**
@@ -59,16 +59,17 @@ interface nsIDOMMozPowerManager : nsISup
      *
      * If you write a value of X into this attribute, the attribute may not have
      * the same value X when you later read it.  Most screens don't support as
      * many different brightness levels as there are doubles between 0 and 1, so
      * we may reduce the value's precision before storing it.
      *
      * @throw NS_ERROR_INVALID_ARG if brightness is not in the range [0, 1].
      */
+    [SetterThrows]
     attribute double screenBrightness;
 
     /**
      * Is it possible that the device's CPU will sleep after the screen is
      * disabled?  Setting this attribute to false will prevent the device
      * entering suspend state.
      */
     attribute boolean cpuSleepAllowed;
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -12,17 +12,16 @@
  * http://www.w3.org/2012/sysapps/runtime/#extension-to-the-navigator-interface-1
  * https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#navigator-interface-extension
  *
  * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
  * Opera Software ASA. You are granted a license to use, reproduce
  * and create derivative works of this document.
  */
 
-interface MozPowerManager;
 interface MozWakeLock;
 
 // http://www.whatwg.org/specs/web-apps/current-work/#the-navigator-object
 [HeaderFile="Navigator.h", NeedNewResolve]
 interface Navigator {
   // objects implementing this interface also implement the interfaces given below
 };
 Navigator implements NavigatorID;
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -206,16 +206,17 @@ WEBIDL_FILES = [
     'MimeType.webidl',
     'MimeTypeArray.webidl',
     'MobileMessageManager.webidl',
     'MouseEvent.webidl',
     'MouseScrollEvent.webidl',
     'MozActivity.webidl',
     'MozMmsMessage.webidl',
     'MozNamedAttrMap.webidl',
+    'MozPowerManager.webidl',
     'MozTimeManager.webidl',
     'MutationEvent.webidl',
     'MutationObserver.webidl',
     'NetDashboard.webidl',
     'Node.webidl',
     'NodeFilter.webidl',
     'NodeIterator.webidl',
     'NodeList.webidl',
@@ -448,17 +449,16 @@ if CONFIG['MOZ_GAMEPAD']:
 
 if CONFIG['MOZ_B2G_RIL']:
     WEBIDL_FILES += [
         'MozStkCommandEvent.webidl',
         'MozVoicemail.webidl',
     ]
 
 WEBIDL_FILES += [
-    'BlobEvent.webidl',
     'CloseEvent.webidl',
     'CustomEvent.webidl',
     'DeviceLightEvent.webidl',
     'DeviceOrientationEvent.webidl',
     'DeviceProximityEvent.webidl',
     'DeviceStorageChangeEvent.webidl',
     'DOMTransactionEvent.webidl',
     'ElementReplaceEvent.webidl',
@@ -532,8 +532,12 @@ if CONFIG['ENABLE_TESTS']:
         'TestJSImplInheritanceGen.webidl',
         'TestTypedef.webidl',
     ]
 
 if CONFIG['MOZ_B2G']:
     WEBIDL_FILES += [
         'InputMethod.webidl',
     ]
+
+GENERATED_EVENTS_WEBIDL_FILES = [
+    'BlobEvent.webidl',
+]
--- a/dom/wifi/DOMWifiManager.js
+++ b/dom/wifi/DOMWifiManager.js
@@ -82,16 +82,17 @@ DOMWifiManager.prototype = {
     this._lastConnectionInfo = null;
 
     const messages = ["WifiManager:getNetworks:Return:OK", "WifiManager:getNetworks:Return:NO",
                       "WifiManager:getKnownNetworks:Return:OK", "WifiManager:getKnownNetworks:Return:NO",
                       "WifiManager:associate:Return:OK", "WifiManager:associate:Return:NO",
                       "WifiManager:forget:Return:OK", "WifiManager:forget:Return:NO",
                       "WifiManager:wps:Return:OK", "WifiManager:wps:Return:NO",
                       "WifiManager:setPowerSavingMode:Return:OK", "WifiManager:setPowerSavingMode:Return:NO",
+                      "WifiManager:setHttpProxy:Return:OK", "WifiManager:setHttpProxy:Return:NO",
                       "WifiManager:setStaticIpMode:Return:OK", "WifiManager:setStaticIpMode:Return:NO",
                       "WifiManager:wifiDown", "WifiManager:wifiUp",
                       "WifiManager:onconnecting", "WifiManager:onassociate",
                       "WifiManager:onconnect", "WifiManager:ondisconnect",
                       "WifiManager:onwpstimeout", "WifiManager:onwpsfail",
                       "WifiManager:onwpsoverlap", "WifiManager:connectionInfoUpdate",
                       "WifiManager:onconnectingfailed"];
     this.initDOMRequestHelper(aWindow, messages);
@@ -189,16 +190,26 @@ DOMWifiManager.prototype = {
         Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
         break;
 
       case "WifiManager:setPowerSavingMode:Return:NO":
         request = this.takeRequest(msg.rid);
         Services.DOMRequest.fireError(request, msg.data);
         break;
 
+      case "WifiManager:setHttpProxy:Return:OK":
+        request = this.takeRequest(msg.rid);
+        Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
+        break;
+
+      case "WifiManager:setHttpProxy:Return:NO":
+        request = this.takeRequest(msg.rid);
+        Services.DOMRequest.fireError(request, msg.data);
+        break;
+
       case "WifiManager:setStaticIpMode:Return:OK":
         request = this.takeRequest(msg.rid);
         Services.DOMRequest.fireSuccess(request, exposeReadOnly(msg.data));
         break;
 
       case "WifiManager:setStaticIpMode:Return:NO":
         request = this.takeRequest(msg.rid);
         Services.DOMRequest.fireError(request, msg.data);
@@ -355,16 +366,24 @@ DOMWifiManager.prototype = {
   setPowerSavingMode: function nsIDOMWifiManager_setPowerSavingMode(enabled) {
     if (!this._hasPrivileges)
       throw new Components.Exception("Denied", Cr.NS_ERROR_FAILURE);
     var request = this.createRequest();
     this._sendMessageForRequest("WifiManager:setPowerSavingMode", enabled, request);
     return request;
   },
 
+  setHttpProxy: function nsIDOMWifiManager_setHttpProxy(network, info) {
+    if (!this._hasPrivileges)
+      throw new Components.Exception("Denied", Cr.NS_ERROR_FAILURE);
+    var request = this.createRequest();
+    this._sendMessageForRequest("WifiManager:setHttpProxy", {network:network, info:info}, request);
+    return request;
+  },
+
   setStaticIpMode: function nsIDOMWifiManager_setStaticIpMode(network, info) {
     if (!this._hasPrivileges)
       throw new Components.Exception("Denied", Cr.NS_ERROR_FAILURE);
     var request = this.createRequest();
     this._sendMessageForRequest("WifiManager:setStaticIpMode", {network: network,info: info}, request);
     return request;
   },
 
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -642,16 +642,58 @@ var WifiManager = (function() {
   }
 
   function resetConnections(ifname, callback) {
     controlMessage({ cmd: "ifc_reset_connections", ifname: ifname }, function(data) {
       callback(!data.status);
     });
   }
 
+  var httpProxyConfig = Object.create(null);
+
+  /**
+   * Given a network, configure http proxy when using wifi.
+   * @param network A network object to update http proxy
+   * @param info Info should have following field:
+   *        - httpProxyHost ip address of http proxy.
+   *        - httpProxyPort port of http proxy, set 0 to use default port 8080.
+   * @param callback callback function.
+   */
+  function configureHttpProxy(network, info, callback) {
+    if (!network)
+      return;
+
+    let networkKey = getNetworkKey(network);
+
+    if (!info || info.httpProxyHost === "") {
+      delete httpProxyConfig[networkKey];
+    } else {
+      httpProxyConfig[networkKey] = network;
+      httpProxyConfig[networkKey].httpProxyHost = info.httpProxyHost;
+      httpProxyConfig[networkKey].httpProxyPort = info.httpProxyPort;
+    }
+
+    callback(true);
+  }
+
+  function getHttpProxyNetwork(network) {
+    if (!network)
+      return null;
+
+    let networkKey = getNetworkKey(network);
+    return ((networkKey in httpProxyConfig) ? httpProxyConfig : null);
+  }
+
+  function setHttpProxy(network) {
+    if (!network)
+      return;
+
+    gNetworkManager.setNetworkProxy(network);
+  }
+
   var staticIpConfig = Object.create(null);
   function setStaticIpMode(network, info, callback) {
     let setNetworkKey = getNetworkKey(network);
     let curNetworkKey = null;
     let currentNetwork = Object.create(null);
     currentNetwork.netId = manager.connectionInfo.id;
 
     manager.getNetworkConfiguration(currentNetwork, function (){
@@ -1543,16 +1585,19 @@ var WifiManager = (function() {
   manager.setBackgroundScan = setBackgroundScan;
   manager.scan = scanCommand;
   manager.wpsPbc = wpsPbcCommand;
   manager.wpsPin = wpsPinCommand;
   manager.wpsCancel = wpsCancelCommand;
   manager.setPowerMode = (sdkVersion >= 16)
                          ? setPowerModeCommandJB
                          : setPowerModeCommandICS;
+  manager.getHttpProxyNetwork = getHttpProxyNetwork;
+  manager.setHttpProxy = setHttpProxy;
+  manager.configureHttpProxy = configureHttpProxy;
   manager.setSuspendOptimizations = setSuspendOptimizationsCommand;
   manager.setStaticIpMode = setStaticIpMode;
   manager.getRssiApprox = getRssiApproxCommand;
   manager.getLinkSpeed = getLinkSpeedCommand;
   manager.getDhcpInfo = function() { return dhcpInfo; }
   manager.getConnectionInfo = (sdkVersion >= 15)
                               ? getConnectionInfoICS
                               : getConnectionInfoGB;
@@ -1846,16 +1891,17 @@ function WifiWorker() {
   var self = this;
 
   this._mm = Cc["@mozilla.org/parentprocessmessagemanager;1"]
                .getService(Ci.nsIMessageListenerManager);
   const messages = ["WifiManager:getNetworks", "WifiManager:getKnownNetworks",
                     "WifiManager:associate", "WifiManager:forget",
                     "WifiManager:wps", "WifiManager:getState",
                     "WifiManager:setPowerSavingMode",
+                    "WifiManager:setHttpProxy",
                     "WifiManager:setStaticIpMode",
                     "child-process-shutdown"];
 
   messages.forEach((function(msgName) {
     this._mm.addMessageListener(msgName, this);
   }).bind(this));
 
   Services.obs.addObserver(this, kMozSettingsChangedObserverTopic, false);
@@ -2155,16 +2201,21 @@ function WifiWorker() {
           // In this case, we connected to an already-connected wpa_supplicant,
           // because of that we need to gather information about the current
           // network here.
           self.currentNetwork = { ssid: quote(WifiManager.connectionInfo.ssid),
                                   netId: WifiManager.connectionInfo.id };
           WifiManager.getNetworkConfiguration(self.currentNetwork, function(){});
         }
 
+        // Update http proxy when connected to network.
+        let netConnect = WifiManager.getHttpProxyNetwork(self.currentNetwork);
+        if (netConnect)
+          WifiManager.setHttpProxy(netConnect);
+
         // The full authentication process is completed, reset the count.
         WifiManager.authenticationFailuresCount = 0;
         WifiManager.loopDetectionCount = 0;
         self._startConnectionInfoTimer();
         self._fireEvent("onassociate", { network: netToDOM(self.currentNetwork) });
         break;
       case "CONNECTED":
         // BSSID is read after connected, update it.
@@ -2177,16 +2228,33 @@ function WifiWorker() {
           this.prevState === "DISCONNECTED" ||
           this.prevState === "INTERFACE_DISABLED" ||
           this.prevState === "INACTIVE" ||
           this.prevState === "UNINITIALIZED") {
           return;
         }
 
         self._fireEvent("ondisconnect", {});
+
+        // When disconnected, clear the http proxy setting if it exists.
+        // Temporarily set http proxy to empty and restore user setting after setHttpProxy.
+        let netDisconnect = WifiManager.getHttpProxyNetwork(self.currentNetwork);
+        if (netDisconnect) {
+          let prehttpProxyHostSetting = netDisconnect.httpProxyHost;
+          let prehttpProxyPortSetting = netDisconnect.httpProxyPort;
+
+          netDisconnect.httpProxyHost = "";
+          netDisconnect.httpProxyPort = 0;
+
+          WifiManager.setHttpProxy(netDisconnect);
+
+          netDisconnect.httpProxyHost = prehttpProxyHostSetting;
+          netDisconnect.httpProxyPort = prehttpProxyPortSetting;
+        }
+
         self.currentNetwork = null;
         self.ipAddress = "";
 
         if (self._turnOnBackgroundScan) {
           self._turnOnBackgroundScan = false;
           WifiManager.setBackgroundScan("ON", function(did_something, ok) {
             WifiManager.reassociate(function() {});
           });
@@ -2711,16 +2779,19 @@ WifiWorker.prototype = {
         this.forget(msg);
         break;
       case "WifiManager:wps":
         this.wps(msg);
         break;
       case "WifiManager:setPowerSavingMode":
         this.setPowerSavingMode(msg);
         break;
+      case "WifiManager:setHttpProxy":
+        this.setHttpProxy(msg);
+        break;
       case "WifiManager:setStaticIpMode":
         this.setStaticIpMode(msg);
         break;
       case "WifiManager:getState": {
         let i;
         if ((i = this._domManagers.indexOf(msg.manager)) === -1) {
           this._domManagers.push(msg.manager);
         }
@@ -3205,16 +3276,40 @@ WifiWorker.prototype = {
           self._sendMessage(message, true, true, msg);
         } else {
           self._sendMessage(message, false, "Set power saving mode failed", msg);
         }
       });
     });
   },
 
+  setHttpProxy: function(msg) {
+    const message = "WifiManager:setHttpProxy:Return";
+    let self = this;
+    let network = msg.data.network;
+    let info = msg.data.info;
+
+    netFromDOM(network, null);
+
+    WifiManager.configureHttpProxy(network, info, function(ok) {
+      if (ok) {
+        // If configured network is current connected network
+        // need update http proxy immediately.
+        let setNetworkKey = getNetworkKey(network);
+        let curNetworkKey = self.currentNetwork ? getNetworkKey(self.currentNetwork) : null;
+        if (setNetworkKey === curNetworkKey)
+          WifiManager.setHttpProxy(network);
+
+        self._sendMessage(message, true, true, msg);
+      } else {
+        self._sendMessage(message, false, "Set http proxy failed", msg);
+      }
+    });
+  },
+
   setStaticIpMode: function(msg) {
     const message = "WifiManager:setStaticMode:Return";
     let self = this;
     let network = msg.data.network;
     let info = msg.data.info;
 
     netFromDOM(network, null);
 
--- a/dom/wifi/nsIWifi.idl
+++ b/dom/wifi/nsIWifi.idl
@@ -54,17 +54,17 @@ interface nsIWifi : nsISupports
      * currently configured networks.
      *
      * On success a callback is notified with the list of networks.
      * On failure after 3 scan retry attempts a callback is notified of failure.
      */
     void getWifiScanResults(in nsIWifiScanResultsReady callback);
 };
 
-[scriptable, uuid(3f21012d-6e75-4632-b87c-acdd7c57fbf3)]
+[scriptable, uuid(e5a72295-1c5f-4848-9cbb-f1d3785c16c1)]
 interface nsIDOMWifiManager : nsISupports
 {
     /**
      * Returns the list of currently available networks.
      * onsuccess: We have obtained the current list of networks. request.value
      *            is an object whose property names are SSIDs and values are
      *            network objects.
      * onerror: We were unable to obtain a list of property names.
@@ -141,16 +141,29 @@ interface nsIDOMWifiManager : nsISupport
      *        - dns2 configured seconf DNS server address
      * onsuccess: We have successfully configure the static ip mode.
      * onerror: We have failed to configure the static ip mode.
      */
     nsIDOMDOMRequest setStaticIpMode(in jsval network,
                                      in jsval info);
 
     /**
+     * Given a network, configure http proxy when using wifi.
+     * @param network A network object with the SSID of the network to set http proxy.
+     * @param info info should have following field:
+     *        - httpProxyHost ip address of http proxy.
+     *        - httpProxyPort port of http proxy, set 0 to use default port 8080.
+     *        set info to null to clear http proxy.
+     * onsuccess: We have successfully configure http proxy.
+     * onerror: We have failed to configure http proxy.
+     */
+    nsIDOMDOMRequest setHttpProxy(in jsval network,
+                                  in jsval info);
+
+    /**
      * Returns whether or not wifi is currently enabled.
      */
     readonly attribute boolean enabled;
 
     /**
      * Returns the MAC address of the wifi adapter.
      */
     readonly attribute DOMString macAddress;
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WorkerScope.h"
 
 #include "jsapi.h"
 #include "js/OldDebugAPI.h"
 #include "mozilla/Util.h"
 #include "mozilla/dom/DOMJSClass.h"
+#include "mozilla/dom/EventBinding.h"
 #include "mozilla/dom/EventTargetBinding.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/DOMExceptionBinding.h"
 #include "mozilla/dom/FileReaderSyncBinding.h"
 #include "mozilla/dom/ImageData.h"
 #include "mozilla/dom/ImageDataBinding.h"
 #include "mozilla/dom/TextDecoderBinding.h"
 #include "mozilla/dom/TextEncoderBinding.h"
@@ -1092,16 +1093,17 @@ CreateDedicatedWorkerGlobalScope(JSConte
   // Init other classes we care about.
   if (!events::InitClasses(aCx, global, false) ||
       !file::InitClasses(aCx, global)) {
     return NULL;
   }
 
   // Init other paris-bindings.
   if (!DOMExceptionBinding::GetConstructorObject(aCx, global) ||
+      !EventBinding::GetConstructorObject(aCx, global) ||
       !FileReaderSyncBinding_workers::GetConstructorObject(aCx, global) ||
       !ImageDataBinding::GetConstructorObject(aCx, global) ||
       !TextDecoderBinding::GetConstructorObject(aCx, global) ||
       !TextEncoderBinding::GetConstructorObject(aCx, global) ||
       !XMLHttpRequestBinding_workers::GetConstructorObject(aCx, global) ||
       !XMLHttpRequestUploadBinding_workers::GetConstructorObject(aCx, global) ||
       !URLBinding_workers::GetConstructorObject(aCx, global) ||
       !WorkerLocationBinding_workers::GetConstructorObject(aCx, global) ||
--- a/gfx/gl/GfxTexturesReporter.h
+++ b/gfx/gl/GfxTexturesReporter.h
@@ -1,14 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set ts=8 sts=4 et sw=4 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef GFXTEXTURESREPORTER_H_
+#define GFXTEXTURESREPORTER_H_
+
 #include "nsIMemoryReporter.h"
 #include "GLTypes.h"
 
 namespace mozilla {
 namespace gl {
 
 class GfxTexturesReporter MOZ_FINAL : public MemoryReporterBase
 {
@@ -40,9 +43,11 @@ public:
 
 private:
     int64_t Amount() MOZ_OVERRIDE { return sAmount; }
 
     static int64_t sAmount;
 };
 
 }
-}
\ No newline at end of file
+}
+
+#endif // GFXTEXTURESREPORTER_H_
--- a/gfx/gl/TextureGarbageBin.h
+++ b/gfx/gl/TextureGarbageBin.h
@@ -1,14 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set ts=8 sts=4 et sw=4 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifndef TEXTUREGARBAGEBIN_H_
+#define TEXTUREGARBAGEBIN_H_
+
 #include <stack>
 
 #include "mozilla/Mutex.h"
 #include "nsISupportsImpl.h"
 
 #include "GLContextTypes.h"
 
 namespace mozilla {
@@ -30,8 +33,10 @@ public:
 
     void GLContextTeardown();
     void Trash(GLuint tex);
     void EmptyGarbage();
 };
 
 }
 }
+
+#endif // TEXTUREGARBAGEBIN_H_
--- a/gfx/layers/composite/AsyncCompositionManager.cpp
+++ b/gfx/layers/composite/AsyncCompositionManager.cpp
@@ -33,16 +33,17 @@
 #include "nsRegion.h"                   // for nsIntRegion
 #include "nsStyleAnimation.h"           // for nsStyleAnimation::Value, etc
 #include "nsTArray.h"                   // for nsTArray, nsTArray_Impl, etc
 #include "nsTArrayForwardDeclare.h"     // for InfallibleTArray
 #if defined(MOZ_WIDGET_ANDROID)
 # include <android/log.h>
 # include "AndroidBridge.h"
 #endif
+#include "GeckoProfiler.h"
 
 struct nsCSSValueList;
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 namespace layers {
 
@@ -634,16 +635,17 @@ AsyncCompositionManager::TransformScroll
   // Make sure fixed position layers don't move away from their anchor points
   // when we're asynchronously panning or zooming
   AlignFixedLayersForAnchorPoint(aLayer, aLayer, oldTransform, fixedLayerMargins);
 }
 
 bool
 AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame)
 {
+  PROFILER_LABEL("AsyncCompositionManager", "TransformShadowTree");
   Layer* root = mLayerManager->GetRoot();
   if (!root) {
     return false;
   }
 
   // NB: we must sample animations *before* sampling pan/zoom
   // transforms.
   bool wantNextFrame = SampleAnimations(root, aCurrentFrame);
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -46,16 +46,17 @@
 #include "nsISupportsImpl.h"            // for Layer::AddRef, etc
 #include "nsIWidget.h"                  // for nsIWidget
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsRect.h"                     // for nsIntRect
 #include "nsRegion.h"                   // for nsIntRegion, etc
 #ifdef MOZ_WIDGET_ANDROID
 #include <android/log.h>
 #endif
+#include "GeckoProfiler.h"
 
 class gfxASurface;
 class gfxContext;
 struct nsIntSize;
 
 
 namespace mozilla {
 namespace layers {
@@ -318,18 +319,20 @@ LayerManagerComposite::Render()
     return;
   }
 
   if (mComposer2D && mComposer2D->TryRender(mRoot, mWorldMatrix)) {
     mCompositor->EndFrameForExternalComposition(mWorldMatrix);
     return;
   }
 
-  
-  mCompositor->GetWidget()->PreRender(this);
+  {
+    PROFILER_LABEL("LayerManagerComposite", "PreRender");
+    mCompositor->GetWidget()->PreRender(this);
+  }
 
   nsIntRect clipRect;
   Rect bounds(mRenderBounds.x, mRenderBounds.y, mRenderBounds.width, mRenderBounds.height);
   Rect actualBounds;
   if (mRoot->GetClipRect()) {
     clipRect = *mRoot->GetClipRect();
     WorldTransformRect(clipRect);
     Rect rect(clipRect.x, clipRect.y, clipRect.width, clipRect.height);
@@ -357,17 +360,20 @@ LayerManagerComposite::Render()
   mCompositor->GetWidget()->DrawWindowOverlay(this, nsIntRect(actualBounds.x,
                                                               actualBounds.y,
                                                               actualBounds.width,
                                                               actualBounds.height));
 
   // Debugging
   RenderDebugOverlay(actualBounds);
 
-  mCompositor->EndFrame();
+  {
+    PROFILER_LABEL("LayerManagerComposite", "EndFrame");
+    mCompositor->EndFrame();
+  }
 }
 
 void
 LayerManagerComposite::SetWorldTransform(const gfxMatrix& aMatrix)
 {
   NS_ASSERTION(aMatrix.PreservesAxisAlignedRectangles(),
                "SetWorldTransform only accepts matrices that satisfy PreservesAxisAlignedRectangles");
   NS_ASSERTION(!aMatrix.HasNonIntegerScale(),
--- a/gfx/layers/composite/ThebesLayerComposite.cpp
+++ b/gfx/layers/composite/ThebesLayerComposite.cpp
@@ -23,16 +23,17 @@
 #include "nsAString.h"
 #include "nsAutoPtr.h"                  // for nsRefPtr
 #include "nsMathUtils.h"                // for NS_lround
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsRect.h"                     // for nsIntRect
 #include "nsSize.h"                     // for nsIntSize
 #include "nsString.h"                   // for nsAutoCString
 #include "nsTraceRefcnt.h"              // for MOZ_COUNT_CTOR, etc
+#include "GeckoProfiler.h"
 
 namespace mozilla {
 namespace layers {
 
 class TiledLayerComposer;
 
 ThebesLayerComposite::ThebesLayerComposite(LayerManagerComposite *aManager)
   : ThebesLayer(aManager, nullptr)
@@ -95,16 +96,17 @@ ThebesLayerComposite::GetRenderState()
 
 void
 ThebesLayerComposite::RenderLayer(const nsIntPoint& aOffset,
                                   const nsIntRect& aClipRect)
 {
   if (!mBuffer || !mBuffer->IsAttached()) {
     return;
   }
+  PROFILER_LABEL("ThebesLayerComposite", "RenderLayer");
 
   MOZ_ASSERT(mBuffer->GetCompositor() == mCompositeManager->GetCompositor() &&
              mBuffer->GetLayer() == this,
              "buffer is corrupted");
 
   gfx::Matrix4x4 transform;
   ToMatrix4x4(GetEffectiveTransform(), transform);
   gfx::Rect clipRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height);
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -42,16 +42,17 @@
 #include "nsTArray.h"                   // for nsTArray
 #include "nsThreadUtils.h"              // for NS_IsMainThread
 #include "nsTraceRefcnt.h"              // for MOZ_COUNT_CTOR, etc
 #include "nsXULAppAPI.h"                // for XRE_GetIOMessageLoop
 #ifdef XP_WIN
 #include "mozilla/layers/CompositorD3D11.h"
 #include "mozilla/layers/CompositorD3D9.h"
 #endif
+#include "GeckoProfiler.h"
 
 using namespace base;
 using namespace mozilla;
 using namespace mozilla::ipc;
 using namespace std;
 
 namespace mozilla {
 namespace layers {
@@ -486,16 +487,17 @@ CompositorParent::ScheduleComposition()
   } else {
     ScheduleTask(mCurrentCompositeTask, 0);
   }
 }
 
 void
 CompositorParent::Composite()
 {
+  PROFILER_LABEL("CompositorParent", "Composite");
   NS_ABORT_IF_FALSE(CompositorThreadID() == PlatformThread::CurrentId(),
                     "Composite can only be called on the compositor thread");
   mCurrentCompositeTask = nullptr;
 
   mLastCompose = TimeStamp::Now();
 
   if (!CanComposite()) {
     return;
@@ -536,16 +538,17 @@ CompositorParent::Composite()
                   15 + (int)(TimeStamp::Now() - mExpectedComposeTime).ToMilliseconds());
   }
 #endif
 }
 
 void
 CompositorParent::ComposeToTarget(gfxContext* aTarget)
 {
+  PROFILER_LABEL("CompositorParent", "ComposeToTarget");
   AutoRestore<bool> override(mOverrideComposeReadiness);
   mOverrideComposeReadiness = true;
 
   if (!CanComposite()) {
     return;
   }
   mLayerManager->BeginTransactionWithTarget(aTarget);
   // Since CanComposite() is true, Composite() must end the layers txn
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -33,16 +33,17 @@
 #include "nsCoord.h"                    // for NSAppUnitsToFloatPixels
 #include "nsDebug.h"                    // for NS_RUNTIMEABORT
 #include "nsISupportsImpl.h"            // for Layer::Release, etc
 #include "nsLayoutUtils.h"              // for nsLayoutUtils
 #include "nsMathUtils.h"                // for NS_round
 #include "nsPoint.h"                    // for nsPoint
 #include "nsTArray.h"                   // for nsTArray, nsTArray_Impl, etc
 #include "nsTraceRefcnt.h"              // for MOZ_COUNT_CTOR, etc
+#include "GeckoProfiler.h"
 
 typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
 
 using mozilla::layout::RenderFrameParent;
 
 namespace mozilla {
 namespace layers {
 
@@ -181,16 +182,17 @@ LayerTransactionParent::RecvUpdateNoSwap
 }
 
 bool
 LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
                                    const TargetConfig& targetConfig,
                                    const bool& isFirstPaint,
                                    InfallibleTArray<EditReply>* reply)
 {
+  PROFILER_LABEL("LayerTransactionParent", "RecvUpdate");
 #ifdef COMPOSITOR_PERFORMANCE_WARNING
   TimeStamp updateStart = TimeStamp::Now();
 #endif
 
   MOZ_LAYERS_LOG(("[ParentSide] received txn with %d edits", cset.Length()));
 
   if (mDestroyed || !layer_manager() || layer_manager()->IsDestroyed()) {
     return true;
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -39,16 +39,17 @@
 #include "nsRect.h"                     // for nsIntRect
 #include "nsServiceManagerUtils.h"      // for do_GetService
 #include "nsString.h"                   // for nsString, nsAutoCString, etc
 #include "prtypes.h"                    // for PR_INT32_MAX
 
 #if MOZ_ANDROID_OMTC
 #include "TexturePoolOGL.h"
 #endif
+#include "GeckoProfiler.h"
 
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
 
@@ -775,16 +776,17 @@ CalculatePOTSize(const IntSize& aSize, G
   return IntSize(NextPowerOfTwo(aSize.width), NextPowerOfTwo(aSize.height));
 }
 
 void
 CompositorOGL::BeginFrame(const Rect *aClipRectIn, const gfxMatrix& aTransform,
                           const Rect& aRenderBounds, Rect *aClipRectOut,
                           Rect *aRenderBoundsOut)
 {
+  PROFILER_LABEL("CompositorOGL", "BeginFrame");
   MOZ_ASSERT(!mFrameInProgress, "frame still in progress (should have called EndFrame or AbortFrame");
 
   mVBOs.Reset();
 
   mFrameInProgress = true;
   gfxRect rect;
   if (mUseExternalSurfaceSize) {
     rect = gfxRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
@@ -1005,16 +1007,17 @@ private:
 };
 
 void
 CompositorOGL::DrawQuad(const Rect& aRect, const Rect& aClipRect,
                         const EffectChain &aEffectChain,
                         Float aOpacity, const gfx::Matrix4x4 &aTransform,
                         const Point& aOffset)
 {
+  PROFILER_LABEL("CompositorOGL", "DrawQuad");
   MOZ_ASSERT(mFrameInProgress, "frame not started");
 
   IntRect intClipRect;
   aClipRect.ToIntRect(&intClipRect);
   mGLContext->PushScissorRect(nsIntRect(intClipRect.x, intClipRect.y,
                                         intClipRect.width, intClipRect.height));
 
   MaskType maskType;
@@ -1269,16 +1272,17 @@ CompositorOGL::DrawQuad(const Rect& aRec
   mGLContext->fActiveTexture(LOCAL_GL_TEXTURE0);
   // in case rendering has used some other GL context
   MakeCurrent();
 }
 
 void
 CompositorOGL::EndFrame()
 {
+  PROFILER_LABEL("CompositorOGL", "BeginFrame");
   MOZ_ASSERT(mCurrentRenderTarget == mWindowRenderTarget, "Rendering target not properly restored");
 
 #ifdef MOZ_DUMP_PAINTING
   if (gfxUtils::sDumpPainting) {
     nsIntRect rect;
     if (mUseExternalSurfaceSize) {
       rect = nsIntRect(0, 0, mSurfaceSize.width, mSurfaceSize.height);
     } else {
--- a/gfx/layers/opengl/TextureHostOGL.cpp
+++ b/gfx/layers/opengl/TextureHostOGL.cpp
@@ -23,16 +23,17 @@
 #include "mozilla/layers/YCbCrImageDataSerializer.h"
 #include "mozilla/layers/GrallocTextureHost.h"
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsRegion.h"                   // for nsIntRegion
 #include "GfxTexturesReporter.h"        // for GfxTexturesReporter
 #ifdef XP_MACOSX
 #include "SharedSurfaceIO.h"
 #endif
+#include "GeckoProfiler.h"
 
 using namespace mozilla::gl;
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layers {
 
 class Compositor; 
@@ -1085,16 +1086,17 @@ GrallocDeprecatedTextureHostOGL::SwapTex
 gl::GLContext*
 GrallocDeprecatedTextureHostOGL::gl() const
 {
   return mCompositor ? mCompositor->gl() : nullptr;
 }
 
 void GrallocDeprecatedTextureHostOGL::BindTexture(GLenum aTextureUnit)
 {
+  PROFILER_LABEL("Gralloc", "BindTexture");
   /*
    * The job of this function is to ensure that the texture is tied to the
    * android::GraphicBuffer, so that texturing will source the GraphicBuffer.
    *
    * To this effect we create an EGLImage wrapping this GraphicBuffer,
    * using CreateEGLImageForNativeBuffer, and then we tie this EGLImage to our
    * texture using fEGLImageTargetTexture2D.
    *
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2953,17 +2953,19 @@ gfxFont::GetShapedWord(gfxContext *aCont
                        const T    *aText,
                        uint32_t    aLength,
                        uint32_t    aHash,
                        int32_t     aRunScript,
                        int32_t     aAppUnitsPerDevUnit,
                        uint32_t    aFlags)
 {
     // if the cache is getting too big, flush it and start over
-    if (mWordCache->Count() > 10000) {
+    uint32_t wordCacheMaxEntries =
+        gfxPlatform::GetPlatform()->WordCacheMaxEntries();
+    if (mWordCache->Count() > wordCacheMaxEntries) {
         NS_WARNING("flushing shaped-word cache");
         ClearCachedWords();
     }
 
     // if there's a cached entry for this word, just return it
     CacheHashKey key(aText, aLength, aHash,
                      aRunScript,
                      aAppUnitsPerDevUnit,
@@ -3237,16 +3239,18 @@ gfxFont::SplitAndInitTextRun(gfxContext 
 
     if (BypassShapedWordCache(aRunScript)) {
         return ShapeTextWithoutWordCache(aContext, aString + aRunStart,
                                          aRunStart, aRunLength, aRunScript,
                                          aTextRun);
     }
 
     InitWordCache();
+    uint32_t wordCacheCharLimit =
+        gfxPlatform::GetPlatform()->WordCacheCharLimit();
 
     // the only flags we care about for ShapedWord construction/caching
     uint32_t flags = aTextRun->GetFlags();
     flags &= (gfxTextRunFactory::TEXT_IS_RTL |
               gfxTextRunFactory::TEXT_DISABLE_OPTIONAL_LIGATURES);
     if (sizeof(T) == sizeof(uint8_t)) {
         flags |= gfxTextRunFactory::TEXT_IS_8BIT;
     }
@@ -3274,19 +3278,19 @@ gfxFont::SplitAndInitTextRun(gfxContext 
             }
             // include this character in the hash, and move on to next
             hash = HashMix(hash, ch);
             continue;
         }
 
         // We've decided to break here (i.e. we're at the end of a "word");
         // shape the word and add it to the textrun.
-        // For words longer than gfxShapedWord::kMaxLength, we don't use the
+        // For words longer than the limit, we don't use the
         // font's word cache but just shape directly into the textrun.
-        if (length > gfxShapedWord::kMaxLength) {
+        if (length > wordCacheCharLimit) {
             bool ok = ShapeFragmentWithoutWordCache(aContext,
                                                     text + wordStart,
                                                     aRunStart + wordStart,
                                                     length,
                                                     aRunScript,
                                                     aTextRun);
             if (!ok) {
                 return false;
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -2462,32 +2462,31 @@ protected:
  * particular font, without regard to external context.
  *
  * The glyph data is copied into gfxTextRuns as needed from the cache of
  * ShapedWords associated with each gfxFont instance.
  */
 class gfxShapedWord : public gfxShapedText
 {
 public:
-    static const uint32_t kMaxLength = 32;
-
     // Create a ShapedWord that can hold glyphs for aLength characters,
     // with mCharacterGlyphs sized appropriately.
     //
     // Returns null on allocation failure (does NOT use infallible alloc)
     // so caller must check for success.
     //
     // This does NOT perform shaping, so the returned word contains no
     // glyph data; the caller must call gfxFont::ShapeText() with appropriate
     // parameters to set up the glyphs.
     static gfxShapedWord* Create(const uint8_t *aText, uint32_t aLength,
                                  int32_t aRunScript,
                                  int32_t aAppUnitsPerDevUnit,
                                  uint32_t aFlags) {
-        NS_ASSERTION(aLength <= kMaxLength, "excessive length for gfxShapedWord!");
+        NS_ASSERTION(aLength <= gfxPlatform::GetPlatform()->WordCacheCharLimit(),
+                     "excessive length for gfxShapedWord!");
 
         // Compute size needed including the mCharacterGlyphs array
         // and a copy of the original text
         uint32_t size =
             offsetof(gfxShapedWord, mCharGlyphsStorage) +
             aLength * (sizeof(CompressedGlyph) + sizeof(uint8_t));
         void *storage = moz_malloc(size);
         if (!storage) {
@@ -2498,17 +2497,18 @@ public:
         return new (storage) gfxShapedWord(aText, aLength, aRunScript,
                                            aAppUnitsPerDevUnit, aFlags);
     }
 
     static gfxShapedWord* Create(const PRUnichar *aText, uint32_t aLength,
                                  int32_t aRunScript,
                                  int32_t aAppUnitsPerDevUnit,
                                  uint32_t aFlags) {
-        NS_ASSERTION(aLength <= kMaxLength, "excessive length for gfxShapedWord!");
+        NS_ASSERTION(aLength <= gfxPlatform::GetPlatform()->WordCacheCharLimit(),
+                     "excessive length for gfxShapedWord!");
 
         // In the 16-bit version of Create, if the TEXT_IS_8BIT flag is set,
         // then we convert the text to an 8-bit version and call the 8-bit
         // Create function instead.
         if (aFlags & gfxTextRunFactory::TEXT_IS_8BIT) {
             nsAutoCString narrowText;
             LossyAppendUTF16toASCII(nsDependentSubstring(aText, aLength),
                                     narrowText);
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -145,16 +145,19 @@ SRGBOverrideObserver::Observe(nsISupport
 #define GFX_DOWNLOADABLE_FONTS_ENABLED "gfx.downloadable_fonts.enabled"
 
 #define GFX_PREF_HARFBUZZ_SCRIPTS "gfx.font_rendering.harfbuzz.scripts"
 #define HARFBUZZ_SCRIPTS_DEFAULT  mozilla::unicode::SHAPING_DEFAULT
 #define GFX_PREF_FALLBACK_USE_CMAPS  "gfx.font_rendering.fallback.always_use_cmaps"
 
 #define GFX_PREF_OPENTYPE_SVG "gfx.font_rendering.opentype_svg.enabled"
 
+#define GFX_PREF_WORD_CACHE_CHARLIMIT "gfx.font_rendering.wordcache.charlimit"
+#define GFX_PREF_WORD_CACHE_MAXENTRIES "gfx.font_rendering.wordcache.maxentries"
+
 #define GFX_PREF_GRAPHITE_SHAPING "gfx.font_rendering.graphite.enabled"
 
 #define BIDI_NUMERAL_PREF "bidi.numeral"
 
 static const char* kObservedPrefs[] = {
     "gfx.downloadable_fonts.",
     "gfx.font_rendering.",
     "bidi.numeral",
@@ -252,16 +255,18 @@ gfxPlatform::gfxPlatform()
   , mDrawLayerBorders(false)
   , mDrawTileBorders(false)
   , mDrawBigImageBorders(false)
 {
     mUseHarfBuzzScripts = UNINITIALIZED_VALUE;
     mAllowDownloadableFonts = UNINITIALIZED_VALUE;
     mFallbackUsesCmaps = UNINITIALIZED_VALUE;
 
+    mWordCacheCharLimit = UNINITIALIZED_VALUE;
+    mWordCacheMaxEntries = UNINITIALIZED_VALUE;
     mGraphiteShapingEnabled = UNINITIALIZED_VALUE;
     mOpenTypeSVGEnabled = UNINITIALIZED_VALUE;
     mBidiNumeralOption = UNINITIALIZED_VALUE;
 
     mLayersPreferMemoryOverShmem =
         XRE_GetProcessType() == GeckoProcessType_Default &&
         Preferences::GetBool("layers.prefer-memory-over-shmem", true);
 
@@ -958,16 +963,44 @@ gfxPlatform::OpenTypeSVGEnabled()
     if (mOpenTypeSVGEnabled == UNINITIALIZED_VALUE) {
         mOpenTypeSVGEnabled =
             Preferences::GetBool(GFX_PREF_OPENTYPE_SVG, false);
     }
 
     return mOpenTypeSVGEnabled > 0;
 }
 
+uint32_t
+gfxPlatform::WordCacheCharLimit()
+{
+    if (mWordCacheCharLimit == UNINITIALIZED_VALUE) {
+        mWordCacheCharLimit =
+            Preferences::GetInt(GFX_PREF_WORD_CACHE_CHARLIMIT, 32);
+        if (mWordCacheCharLimit < 0) {
+            mWordCacheCharLimit = 32;
+        }
+    }
+
+    return uint32_t(mWordCacheCharLimit);
+}
+
+uint32_t
+gfxPlatform::WordCacheMaxEntries()
+{
+    if (mWordCacheMaxEntries == UNINITIALIZED_VALUE) {
+        mWordCacheMaxEntries =
+            Preferences::GetInt(GFX_PREF_WORD_CACHE_MAXENTRIES, 10000);
+        if (mWordCacheMaxEntries < 0) {
+            mWordCacheMaxEntries = 10000;
+        }
+    }
+
+    return uint32_t(mWordCacheMaxEntries);
+}
+
 bool
 gfxPlatform::UseGraphiteShaping()
 {
     if (mGraphiteShapingEnabled == UNINITIALIZED_VALUE) {
         mGraphiteShapingEnabled =
             Preferences::GetBool(GFX_PREF_GRAPHITE_SHAPING, false);
     }
 
@@ -1757,38 +1790,46 @@ int32_t
 gfxPlatform::GetBidiNumeralOption()
 {
     if (mBidiNumeralOption == UNINITIALIZED_VALUE) {
         mBidiNumeralOption = Preferences::GetInt(BIDI_NUMERAL_PREF, 0);
     }
     return mBidiNumeralOption;
 }
 
+static void
+FlushFontAndWordCaches()
+{
+    gfxFontCache *fontCache = gfxFontCache::GetCache();
+    if (fontCache) {
+        fontCache->AgeAllGenerations();
+        fontCache->FlushShapedWordCaches();
+    }
+}
+
 void
 gfxPlatform::FontsPrefsChanged(const char *aPref)
 {
     NS_ASSERTION(aPref != nullptr, "null preference");
     if (!strcmp(GFX_DOWNLOADABLE_FONTS_ENABLED, aPref)) {
         mAllowDownloadableFonts = UNINITIALIZED_VALUE;
     } else if (!strcmp(GFX_PREF_FALLBACK_USE_CMAPS, aPref)) {
         mFallbackUsesCmaps = UNINITIALIZED_VALUE;
+    } else if (!strcmp(GFX_PREF_WORD_CACHE_CHARLIMIT, aPref)) {
+        mWordCacheCharLimit = UNINITIALIZED_VALUE;
+        FlushFontAndWordCaches();
+    } else if (!strcmp(GFX_PREF_WORD_CACHE_MAXENTRIES, aPref)) {
+        mWordCacheMaxEntries = UNINITIALIZED_VALUE;
+        FlushFontAndWordCaches();
     } else if (!strcmp(GFX_PREF_GRAPHITE_SHAPING, aPref)) {
         mGraphiteShapingEnabled = UNINITIALIZED_VALUE;
-        gfxFontCache *fontCache = gfxFontCache::GetCache();
-        if (fontCache) {
-            fontCache->AgeAllGenerations();
-            fontCache->FlushShapedWordCaches();
-        }
+        FlushFontAndWordCaches();
     } else if (!strcmp(GFX_PREF_HARFBUZZ_SCRIPTS, aPref)) {
         mUseHarfBuzzScripts = UNINITIALIZED_VALUE;
-        gfxFontCache *fontCache = gfxFontCache::GetCache();
-        if (fontCache) {
-            fontCache->AgeAllGenerations();
-            fontCache->FlushShapedWordCaches();
-        }
+        FlushFontAndWordCaches();
     } else if (!strcmp(BIDI_NUMERAL_PREF, aPref)) {
         mBidiNumeralOption = UNINITIALIZED_VALUE;
     } else if (!strcmp(GFX_PREF_OPENTYPE_SVG, aPref)) {
         mOpenTypeSVGEnabled = UNINITIALIZED_VALUE;
         gfxFontCache::GetCache()->AgeAllGenerations();
     }
 }
 
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -399,16 +399,26 @@ public:
     bool UseCmapsDuringSystemFallback();
 
     /**
      * Whether to render SVG glyphs within an OpenType font wrapper
      */
     bool OpenTypeSVGEnabled();
 
     /**
+     * Max character length of words in the word cache
+     */
+    uint32_t WordCacheCharLimit();
+
+    /**
+     * Max number of entries in word cache
+     */
+    uint32_t WordCacheMaxEntries();
+
+    /**
      * Whether to use the SIL Graphite rendering engine
      * (for fonts that include Graphite tables)
      */
     bool UseGraphiteShaping();
 
     /**
      * Whether to use the harfbuzz shaper (depending on script complexity).
      *
@@ -667,16 +677,22 @@ protected:
 
     // whether to always search font cmaps globally 
     // when doing system font fallback
     int8_t  mFallbackUsesCmaps;
 
     // which scripts should be shaped with harfbuzz
     int32_t mUseHarfBuzzScripts;
 
+    // max character limit for words in word cache
+    int32_t mWordCacheCharLimit;
+
+    // max number of entries in word cache
+    int32_t mWordCacheMaxEntries;
+
 private:
     /**
      * Start up Thebes.
      */
     static void Init();
 
     static void CreateCMSOutputProfile();
 
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -2019,17 +2019,18 @@ static bool
 IsCacheableSetPropCallNative(HandleObject obj, HandleObject holder, HandleShape shape)
 {
     if (!obj->isNative())
         return false;
 
     if (!shape || !IsCacheableProtoChain(obj, holder))
         return false;
 
-    return shape->hasSetterValue() && shape->setterObject()->is<JSFunction>() &&
+    return shape->hasSetterValue() && shape->setterObject() &&
+           shape->setterObject()->is<JSFunction>() &&
            shape->setterObject()->as<JSFunction>().isNative();
 }
 
 static bool
 IsCacheableSetPropCallPropertyOp(HandleObject obj, HandleObject holder,
                                  HandleShape shape)
 {
     if (!obj->isNative())
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -9,16 +9,17 @@
 #ifdef JS_WORKER_THREADS
 #include "mozilla/DebugOnly.h"
 
 #include "prmjtime.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "jit/ExecutionModeInlines.h"
 #include "jit/IonBuilder.h"
+#include "vm/Debugger.h"
 
 #include "jscntxtinlines.h"
 #include "jscompartmentinlines.h"
 #include "jsobjinlines.h"
 
 using namespace js;
 
 using mozilla::DebugOnly;
@@ -494,22 +495,50 @@ WorkerThreadState::canStartParseTask()
 }
 
 bool
 WorkerThreadState::canStartCompressionTask()
 {
     return !compressionWorklist.empty();
 }
 
+static void
+CallNewScriptHookForAllScripts(JSContext *cx, HandleScript script)
+{
+    // We should never hit this, since nested scripts are also constructed via
+    // BytecodeEmitter instances on the stack.
+    JS_CHECK_RECURSION(cx, return);
+
+    // Recurse to any nested scripts.
+    if (script->hasObjects()) {
+        ObjectArray *objects = script->objects();
+        for (size_t i = 0; i < objects->length; i++) {
+            JSObject *obj = objects->vector[i];
+            if (obj->is<JSFunction>()) {
+                JSFunction *fun = &obj->as<JSFunction>();
+                if (fun->hasScript()) {
+                    RootedScript nested(cx, fun->nonLazyScript());
+                    CallNewScriptHookForAllScripts(cx, nested);
+                }
+            }
+        }
+    }
+
+    // The global new script hook is called on every script that was compiled.
+    RootedFunction function(cx, script->function());
+    CallNewScriptHook(cx, script, function);
+}
+
 JSScript *
 WorkerThreadState::finishParseTask(JSContext *maybecx, JSRuntime *rt, void *token)
 {
     ParseTask *parseTask = NULL;
 
     // The token is a ParseTask* which should be in the finished list.
+    // Find and remove its entry.
     {
         AutoLockWorkerThreadState lock(*rt->workerThreadState);
         for (size_t i = 0; i < parseFinishedList.length(); i++) {
             if (parseFinishedList[i] == token) {
                 parseTask = parseFinishedList[i];
                 parseFinishedList[i] = parseFinishedList.back();
                 parseFinishedList.popBack();
                 break;
@@ -543,25 +572,37 @@ WorkerThreadState::finishParseTask(JSCon
         JS_ASSERT(newProto);
 
         object->proto = newProto;
     }
 
     // Move the parsed script and all its contents into the desired compartment.
     gc::MergeCompartments(parseTask->cx->compartment(), parseTask->scopeChain->compartment());
 
+    RootedScript script(rt, parseTask->script);
+
     // If we have a context, report any error or warnings generated during the
-    // parse.
+    // parse, and inform the debugger about the compiled scripts.
     if (maybecx) {
         AutoCompartment ac(maybecx, parseTask->scopeChain);
         for (size_t i = 0; i < parseTask->errors.length(); i++)
             parseTask->errors[i]->throwError(maybecx);
+
+        if (script) {
+            // The Debugger only needs to be told about the topmost script that was compiled.
+            GlobalObject *compileAndGoGlobal = NULL;
+            if (script->compileAndGo)
+                compileAndGoGlobal = &script->global();
+            Debugger::onNewScript(maybecx, script, compileAndGoGlobal);
+
+            // The NewScript hook needs to be called for all compiled scripts.
+            CallNewScriptHookForAllScripts(maybecx, script);
+        }
     }
 
-    JSScript *script = parseTask->script;
     js_delete(parseTask);
     return script;
 }
 
 void
 WorkerThread::destroy()
 {
     WorkerThreadState &state = *runtime->workerThreadState;
--- a/js/xpconnect/src/event_impl_gen.conf.in
+++ b/js/xpconnect/src/event_impl_gen.conf.in
@@ -46,17 +46,16 @@ simple_events = [
     'ElementReplaceEvent',
     'MozSmsEvent',
     'MozMmsEvent',
 #ifdef MOZ_WEBSPEECH
     'SpeechSynthesisEvent',
 #endif
     'DeviceStorageChangeEvent',
     'PopupBlockedEvent',
-    'BlobEvent',
     'RecordErrorEvent',
 #ifdef MOZ_GAMEPAD
     'GamepadEvent',
     'GamepadButtonEvent',
     'GamepadAxisMoveEvent',
 #endif
 #ifdef MOZ_WEBSPEECH
     'SpeechRecognitionEvent',
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -430,17 +430,17 @@ typedef uint32_t nsReflowStatus;
   (0 != ((status) & NS_FRAME_NOT_COMPLETE))
 
 #define NS_FRAME_OVERFLOW_IS_INCOMPLETE(status) \
   (0 != ((status) & NS_FRAME_OVERFLOW_INCOMPLETE))
 
 #define NS_FRAME_IS_FULLY_COMPLETE(status) \
   (NS_FRAME_IS_COMPLETE(status) && !NS_FRAME_OVERFLOW_IS_INCOMPLETE(status))
 
-// These macros set or switch incompete statuses without touching th
+// These macros set or switch incomplete statuses without touching the
 // NS_FRAME_REFLOW_NEXTINFLOW bit.
 #define NS_FRAME_SET_INCOMPLETE(status) \
   status = (status & ~NS_FRAME_OVERFLOW_INCOMPLETE) | NS_FRAME_NOT_COMPLETE
 
 #define NS_FRAME_SET_OVERFLOW_INCOMPLETE(status) \
   status = (status & ~NS_FRAME_NOT_COMPLETE) | NS_FRAME_OVERFLOW_INCOMPLETE
 
 // This macro tests to see if an nsReflowStatus is an error value
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -68,18 +68,18 @@ load 585185-1.html
 load 592698-1.html
 load 601437-1.html
 load 601439-1.html
 load 605689-1.html
 load 645142.html
 load 611922-1.html
 == 645951-1.html 645951-1-ref.html
 load 665209-1.html
-asserts(2) load 671799-1.html
-asserts(2) load 671799-2.html
+load 671799-1.html
+load 671799-2.html
 load 690990-1.html
 load 696188-1.html
 load 700116.html
 load 729126-1.html
 load 729126-2.html
 skip-if(Android||browserIsRemote) load 786108-1.html # Bug 795534
 skip-if(browserIsRemote) load 786108-2.html # Bug 795534
 load 788836.html
--- a/layout/style/nsFontFaceLoader.cpp
+++ b/layout/style/nsFontFaceLoader.cpp
@@ -617,17 +617,22 @@ nsUserFontSet::InsertRule(nsCSSFontFaceR
         val.GetStringValue(face->mLocalName);
         face->mIsLocal = true;
         face->mURI = nullptr;
         face->mFormatFlags = 0;
         break;
       case eCSSUnit_URL:
         face->mIsLocal = false;
         face->mURI = val.GetURLValue();
-        NS_ASSERTION(face->mURI, "null url in @font-face rule");
+        if (!face->mURI) {
+          // if URI not valid, omit from src array
+          srcArray.RemoveElementAt(srcArray.Length() - 1);
+          NS_WARNING("null url in @font-face rule");
+          continue;
+        }
         face->mReferrer = val.GetURLStructValue()->mReferrer;
         face->mOriginPrincipal = val.GetURLStructValue()->mOriginPrincipal;
         NS_ASSERTION(face->mOriginPrincipal, "null origin principal in @font-face rule");
 
         // agent and user stylesheets are treated slightly differently,
         // the same-site origin check and access control headers are
         // enforced against the sheet principal rather than the document
         // principal to allow user stylesheets to include @font-face rules
--- a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.c
@@ -399,16 +399,27 @@ static int nr_stun_client_send_request(n
 static int nr_stun_client_get_password(void *arg, nr_stun_message *msg, Data **password)
 {
     *password = (Data*)arg;
     if (!arg)
         return(R_NOT_FOUND);
     return(0);
 }
 
+int nr_stun_transport_addr_check(nr_transport_addr* addr)
+  {
+    if(nr_transport_addr_is_wildcard(addr))
+      return(R_BAD_DATA);
+
+    if (nr_transport_addr_is_loopback(addr))
+      return(R_BAD_DATA);
+
+    return(0);
+  }
+
 int nr_stun_client_process_response(nr_stun_client_ctx *ctx, UCHAR *msg, int len, nr_transport_addr *peer_addr)
   {
     int r,_status;
     char string[256];
     char *username;
     Data *password = 0;
     nr_stun_message_attribute *attr;
     nr_transport_addr *mapped_addr = 0;
@@ -617,16 +628,19 @@ int nr_stun_client_process_response(nr_s
         if (! nr_stun_message_has_attribute(ctx->response, NR_STUN_ATTR_XOR_MAPPED_ADDRESS, 0))
             ABORT(R_BAD_DATA);
         if (! nr_stun_message_has_attribute(ctx->response, NR_STUN_ATTR_MESSAGE_INTEGRITY, 0))
             ABORT(R_BAD_DATA);
 
         if (!nr_stun_message_has_attribute(ctx->response, NR_STUN_ATTR_XOR_RELAY_ADDRESS, &attr))
           ABORT(R_BAD_DATA);
 
+        if ((r=nr_stun_transport_addr_check(&attr->u.relay_address.unmasked)))
+          ABORT(r);
+
         if ((r=nr_transport_addr_copy(
                 &ctx->results.allocate_response.relay_addr,
                 &attr->u.relay_address.unmasked)))
           ABORT(r);
 
         if (!nr_stun_message_has_attribute(ctx->response, NR_STUN_ATTR_LIFETIME, &attr))
           ABORT(R_BAD_DATA);
         ctx->results.allocate_response.lifetime_secs=attr->u.lifetime_secs;
@@ -658,20 +672,26 @@ int nr_stun_client_process_response(nr_s
     /* make sure we have the most up-to-date address from this peer */
     if (nr_transport_addr_cmp(&ctx->peer_addr, peer_addr, NR_TRANSPORT_ADDR_CMP_MODE_ALL)) {
         r_log(NR_LOG_STUN,LOG_INFO,"STUN-CLIENT(%s): Peer moved from %s to %s", ctx->label, ctx->peer_addr.as_string, peer_addr->as_string);
         nr_transport_addr_copy(&ctx->peer_addr, peer_addr);
     }
 
     if (mapped_addr) {
         if (nr_stun_message_has_attribute(ctx->response, NR_STUN_ATTR_XOR_MAPPED_ADDRESS, &attr)) {
+            if ((r=nr_stun_transport_addr_check(&attr->u.xor_mapped_address.unmasked)))
+                ABORT(r);
+
             if ((r=nr_transport_addr_copy(mapped_addr, &attr->u.xor_mapped_address.unmasked)))
                 ABORT(r);
         }
         else if (nr_stun_message_has_attribute(ctx->response, NR_STUN_ATTR_MAPPED_ADDRESS, &attr)) {
+            if ((r=nr_stun_transport_addr_check(&attr->u.mapped_address)))
+                ABORT(r);
+
             if ((r=nr_transport_addr_copy(mapped_addr, &attr->u.mapped_address)))
                 ABORT(r);
         }
         else
             ABORT(R_BAD_DATA);
 
 
         r_log(NR_LOG_STUN,LOG_DEBUG,"STUN-CLIENT(%s): Received mapped address: %s", ctx->label, mapped_addr->as_string);
--- a/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.h
+++ b/media/mtransport/third_party/nICEr/src/stun/stun_client_ctx.h
@@ -183,13 +183,14 @@ struct nr_stun_client_ctx_ {
 };
 
 int nr_stun_client_ctx_create(char *label, nr_socket *sock, nr_transport_addr *peer, UINT4 RTO, nr_stun_client_ctx **ctxp);
 int nr_stun_client_start(nr_stun_client_ctx *ctx, int mode, NR_async_cb finished_cb, void *cb_arg);
 int nr_stun_client_restart(nr_stun_client_ctx *ctx);
 int nr_stun_client_force_retransmit(nr_stun_client_ctx *ctx);
 int nr_stun_client_reset(nr_stun_client_ctx *ctx);
 int nr_stun_client_ctx_destroy(nr_stun_client_ctx **ctxp);
+int nr_stun_transport_addr_check(nr_transport_addr* addr);
 int nr_stun_client_process_response(nr_stun_client_ctx *ctx, UCHAR *msg, int len, nr_transport_addr *peer_addr);
 int nr_stun_client_cancel(nr_stun_client_ctx *ctx);
 
 #endif
 
--- a/mobile/android/base/tests/testSettingsMenuItems.java.in
+++ b/mobile/android/base/tests/testSettingsMenuItems.java.in
@@ -10,18 +10,18 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.HashMap;
 
 /** This patch tests the Sections present in the Settings Menu and the
  *  default values for them
  */
 public class testSettingsMenuItems extends PixelTest {
-    int midWidth;
-    int midHeight;
+    int mMidWidth;
+    int mMidHeight;
     String BRAND_NAME = "(Fennec|Nightly|Aurora|Firefox|Firefox Beta)";
 
     /**
      * The following String[][] (arrays) match the menu hierarchy for each section.
      * Each String[] (array) represents the menu items/choices in the following order:
      *
      * itemTitle { defaultValue [options] }
      *
@@ -86,18 +86,18 @@ public class testSettingsMenuItems exten
 
     @Override
     protected int getTestType() {
         return TEST_MOCHITEST;
     }
 
     public void testSettingsMenuItems() {
         blockForGeckoReady();
-        midWidth = mDriver.getGeckoWidth()/2;
-        midHeight = mDriver.getGeckoHeight()/2;
+        mMidWidth = mDriver.getGeckoWidth()/2;
+        mMidHeight = mDriver.getGeckoHeight()/2;
 
         Map<String, List<String[]>> settingsMenuItems = new HashMap<String, List<String[]>>();
         setupSettingsMap(settingsMenuItems);
 
         // Set special handling for Settings items that are conditionally built.
         addConditionalSettings(settingsMenuItems);
 
         selectMenuItem("Settings");
@@ -207,62 +207,63 @@ public class testSettingsMenuItems exten
             for (String[] item : sectionItems) {
                 int itemLen = item.length;
 
                 // Each item must at least have a title.
                 mAsserter.ok(item.length > 0, "Section-item", "Each item must at least have a title");
 
                 // Check item title.
                 String itemTitle = "^" + item[0] + "$";
-                if (!waitForText(itemTitle)) {
-                    // If we don't see the item, scroll down once in case it's off-screen.
-                    scrollDown();
-                }
-                mAsserter.ok(mSolo.waitForText(itemTitle), "Waiting for settings item " + itemTitle + " in section " + section,
+                boolean foundText = waitExtraForText(itemTitle);
+                mAsserter.ok(foundText, "Waiting for settings item " + itemTitle + " in section " + section,
                              "The " + itemTitle + " option is present in section " + section);
                 // Check item default, if it exists.
                 if (itemLen > 1) {
                     String itemDefault = "^" + item[1] + "$";
-                    mAsserter.ok(mSolo.waitForText(itemDefault), "Waiting for settings item default " + itemDefault
+                    foundText = waitExtraForText(itemDefault);
+                    mAsserter.ok(foundText, "Waiting for settings item default " + itemDefault
                                  + " in section " + section,
                                  "The " + itemDefault + " default is present in section " + section);
                 }
                 // Check item choices, if they exist.
                 if (itemLen > 2) {
-                  waitForEnabledText(itemTitle);
-                  mSolo.clickOnText(itemTitle);
-                  for (int i = 2; i < itemLen; i++) {
-                      String itemChoice = "^" + item[i] + "$";
-                      if (!waitForText(itemChoice)) {
-                          // If we don't see the item, scroll down once in case it's off-screen.
-                          scrollDown();
-                      }
-                      mAsserter.ok(mSolo.waitForText(itemChoice), "Waiting for settings item choice " + itemChoice
-                                   + " in section " + section,
-                                   "The " + itemChoice + " choice is present in section " + section);
-                  }
-                  // Leave submenu after checking.
-                  if (waitForText("^Cancel$")) {
-                      mSolo.clickOnText("^Cancel$");
-                  } else {
-                      // Some submenus aren't dialogs, but are nested screens; exit using "back".
-                      mActions.sendSpecialKey(Actions.SpecialKey.BACK);
-                  }
+                    waitForEnabledText(itemTitle);
+                    mSolo.clickOnText(itemTitle);
+                    for (int i = 2; i < itemLen; i++) {
+                        String itemChoice = "^" + item[i] + "$";
+                        foundText = waitExtraForText(itemChoice);
+                        mAsserter.ok(foundText, "Waiting for settings item choice " + itemChoice
+                                     + " in section " + section,
+                                     "The " + itemChoice + " choice is present in section " + section);
+                    }
+                    // Leave submenu after checking.
+                    if (waitForText("^Cancel$")) {
+                        mSolo.clickOnText("^Cancel$");
+                    } else {
+                        // Some submenus aren't dialogs, but are nested screens; exit using "back".
+                        mActions.sendSpecialKey(Actions.SpecialKey.BACK);
+                    }
                 }
             }
             // Navigate back a screen if on a phone.
             if (mDevice.type.equals("phone")) {
                 // Click back to return to previous menu. Tablets shouldn't do this because they use headers and fragments.
                 mActions.sendSpecialKey(Actions.SpecialKey.BACK);
             }
         }
     }
 
-    /**
-     * Hacky way to scroll down.
-     *
-     * solo.scroll* does not work in dialogs.
-     */
-    private void scrollDown() {
-        MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
-        meh.dragSync(midWidth, midHeight+100, midWidth, midHeight-100);
+    // Solo.waitForText usually scrolls down in a view when text is not visible.
+    // In this test, Solo.waitForText scrolling does not work, so we use this
+    // hack to do the same thing.
+    private boolean waitExtraForText(String txt) {
+        boolean foundText = waitForText(txt);
+        if (!foundText) {
+            // If we don't see the item, scroll down once in case it's off-screen.
+            // Hacky way to scroll down.  solo.scroll* does not work in dialogs.
+            MotionEventHelper meh = new MotionEventHelper(getInstrumentation(), mDriver.getGeckoLeft(), mDriver.getGeckoTop());
+            meh.dragSync(mMidWidth, mMidHeight+100, mMidWidth, mMidHeight-100);
+
+            foundText = mSolo.waitForText(txt);
+        }
+        return foundText;
     }
 }
--- a/mobile/android/chrome/content/FeedHandler.js
+++ b/mobile/android/chrome/content/FeedHandler.js
@@ -68,17 +68,17 @@ var FeedHandler = {
       let feeds = browser.feeds;
       if (feeds == null)
         return;
 
       // First, let's decide on which feed to subscribe
       let feedIndex = -1;
       if (feeds.length > 1) {
         let p = new Prompt({
-          window: browser.contentWindow,
+          window: browser.contentWindow
         }).setSingleChoiceItems(feeds.map(function(feed) {
           return { label: feed.title || feed.href }
         })).show((function(data) {
           feedIndex = data.button;
           if (feedIndex == -1)
             return;
 
           this.loadFeed(feeds[feedIndex], browser);
@@ -86,34 +86,33 @@ var FeedHandler = {
         return;
       }
 
       this.loadFeed(feeds[0], browser);
     }
   },
 
   loadFeed: function fh_loadFeed(aFeed, aBrowser) {
-      let feedURL = aFeed.href;
+    let feedURL = aFeed.href;
+
+    // Next, we decide on which service to send the feed
+    let handlers = this.getContentHandlers(this.TYPE_MAYBE_FEED);
+    if (handlers.length == 0)
+      return;
 
-      // Next, we decide on which service to send the feed
-      let handlers = this.getContentHandlers(this.TYPE_MAYBE_FEED);
-      if (handlers.length == 0)
+    // JSON for Prompt
+    let p = new Prompt({
+      window: aBrowser.contentWindow
+    }).setSingleChoiceItems(handlers.map(function(handler) {
+      return { label: handler.name };
+    })).show(function(data) {
+      if (data.button == -1)
         return;
 
-      // JSON for Prompt
-      let p = new Prompt({
-        window: aBrowser.contentWindow
-      }).setSingleChoiceItems(handlers.map(function(handler) {
-        return { label: handler.name };
-      })).show(function(data) {
-        if (data.button == -1)
-          return;
+      // Merge the handler URL and the feed URL
+      let readerURL = handlers[data.button].uri;
+      readerURL = readerURL.replace(/%s/gi, encodeURIComponent(feedURL));
 
-        // Merge the handler URL and the feed URL
-        let readerURL = handlers[data.button].uri;
-        readerURL = readerURL.replace(/%s/gi, encodeURIComponent(feedURL));
-
-        // Open the resultant URL in a new tab
-        BrowserApp.addTab(readerURL, { parentId: BrowserApp.selectedTab.id });
-      });
-
+      // Open the resultant URL in a new tab
+      BrowserApp.addTab(readerURL, { parentId: BrowserApp.selectedTab.id });
+    });
   }
 };
--- a/mobile/locales/en-US/chrome/region.properties
+++ b/mobile/locales/en-US/chrome/region.properties
@@ -24,10 +24,8 @@ gecko.handlerService.schemes.mailto.0.na
 gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s
 gecko.handlerService.schemes.mailto.1.name=Gmail
 gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s
 
 # This is the default set of web based feed handlers shown in the reader
 # selection UI
 browser.contentHandlers.types.0.title=My Yahoo!
 browser.contentHandlers.types.0.uri=http://add.my.yahoo.com/rss?url=%s
-browser.contentHandlers.types.1.title=Google
-browser.contentHandlers.types.1.uri=http://fusion.google.com/add?feedurl=%s
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -287,16 +287,22 @@ pref("gfx.font_loader.interval", 1000); 
 pref("gfx.font_loader.families_per_slice", 3); // read in info 3 families at a time
 pref("gfx.font_loader.delay", 8000);           // 8 secs after startup
 pref("gfx.font_loader.interval", 50);          // run every 50 ms
 #endif
 
 // whether to always search all font cmaps during system font fallback
 pref("gfx.font_rendering.fallback.always_use_cmaps", false);
 
+// cache shaped word results
+pref("gfx.font_rendering.wordcache.charlimit", 32);
+
+// cache shaped word results
+pref("gfx.font_rendering.wordcache.maxentries", 10000);
+
 pref("gfx.font_rendering.graphite.enabled", true);
 
 // Check intl/unicharutil/util/nsUnicodeProperties.h for definitions of script bits
 // in the ShapingType enumeration
 // Currently-defined bits:
 //  SHAPING_DEFAULT   = 0x0001,
 //  SHAPING_ARABIC    = 0x0002,
 //  SHAPING_HEBREW    = 0x0004,
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -190,25 +190,29 @@ class OSXBootstrapper(BaseBootstrapper):
         self.brew = self.which('brew')
         assert self.brew is not None
 
         installed = self.check_output([self.brew, 'list']).split()
 
         packages = [
             # We need to install Python because Mercurial requires the Python
             # development headers which are missing from OS X (at least on
-            # 10.8).
+            # 10.8) and because the build system wants a version newer than
+            # what Apple ships.
             ('python', 'python'),
             ('mercurial', 'mercurial'),
             ('git', 'git'),
             ('yasm', 'yasm'),
             ('autoconf213', HOMEBREW_AUTOCONF213),
-            ('terminal-notifier', 'terminal-notifier'),
         ]
 
+        # terminal-notifier is only available in Mountain Lion or newer.
+        if self.os_version >= StrictVersion('10.8'):
+            packages.append(('terminal-notifier', 'terminal-notifier'))
+
         printed = False
 
         for name, package in packages:
             if name in installed:
                 continue
 
             if not printed:
                 print(PACKAGE_MANAGER_PACKAGES % ('Homebrew',))
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -16,16 +16,17 @@ from mozpack.manifests import (
 )
 import mozpack.path as mozpath
 
 from .common import CommonBackend
 from ..frontend.data import (
     ConfigFileSubstitution,
     DirectoryTraversal,
     Exports,
+    GeneratedEventWebIDLFile,
     GeneratedWebIDLFile,
     IPDLFile,
     LocalInclude,
     PreprocessedWebIDLFile,
     Program,
     SandboxDerived,
     TestWebIDLFile,
     VariablePassthru,
@@ -122,16 +123,17 @@ class RecursiveMakeBackend(CommonBackend
     """
 
     def _init(self):
         CommonBackend._init(self)
 
         self._backend_files = {}
         self._ipdl_sources = set()
         self._webidl_sources = set()
+        self._generated_events_webidl_sources = set()
         self._test_webidl_sources = set()
         self._preprocessed_webidl_sources = set()
         self._generated_webidl_sources = set()
 
         def detailed(summary):
             return '{:d} total backend files. {:d} created; {:d} updated; {:d} unchanged'.format(
                 summary.managed_count, summary.created_count,
                 summary.updated_count, summary.unchanged_count)
@@ -204,28 +206,35 @@ class RecursiveMakeBackend(CommonBackend
         elif isinstance(obj, Exports):
             self._process_exports(obj, obj.exports, backend_file)
 
         elif isinstance(obj, IPDLFile):
             self._ipdl_sources.add(mozpath.join(obj.srcdir, obj.basename))
 
         elif isinstance(obj, WebIDLFile):
             self._webidl_sources.add(mozpath.join(obj.srcdir, obj.basename))
+            self._process_webidl_basename(obj.basename)
+
+        elif isinstance(obj, GeneratedEventWebIDLFile):
+            self._generated_events_webidl_sources.add(mozpath.join(obj.srcdir, obj.basename))
 
         elif isinstance(obj, TestWebIDLFile):
             self._test_webidl_sources.add(mozpath.join(obj.srcdir,
                                                        obj.basename))
+            # Test WebIDL files are not exported.
 
         elif isinstance(obj, GeneratedWebIDLFile):
             self._generated_webidl_sources.add(mozpath.join(obj.srcdir,
                                                             obj.basename))
+            self._process_webidl_basename(obj.basename)
 
         elif isinstance(obj, PreprocessedWebIDLFile):
             self._preprocessed_webidl_sources.add(mozpath.join(obj.srcdir,
                                                                obj.basename))
+            self._process_webidl_basename(obj.basename)
 
         elif isinstance(obj, Program):
             self._process_program(obj.program, backend_file)
 
         elif isinstance(obj, XpcshellManifests):
             self._process_xpcshell_manifests(obj, backend_file)
 
         elif isinstance(obj, LocalInclude):
@@ -296,16 +305,18 @@ class RecursiveMakeBackend(CommonBackend
         self.summary.managed_count += 1
 
         # Write out master lists of WebIDL source files.
         webidls = FileAvoidWrite(os.path.join(self.environment.topobjdir,
               'dom', 'bindings', 'webidlsrcs.mk'))
 
         for webidl in sorted(self._webidl_sources):
             webidls.write('webidl_files += %s\n' % os.path.basename(webidl))
+        for webidl in sorted(self._generated_events_webidl_sources):
+            webidls.write('generated_events_webidl_files += %s\n' % os.path.basename(webidl))
         for webidl in sorted(self._test_webidl_sources):
             webidls.write('test_webidl_files += %s\n' % os.path.basename(webidl))
         for webidl in sorted(self._generated_webidl_sources):
             webidls.write('generated_webidl_files += %s\n' % os.path.basename(webidl))
         for webidl in sorted(self._preprocessed_webidl_sources):
             webidls.write('preprocessed_webidl_files += %s\n' % os.path.basename(webidl))
 
         self._update_from_avoid_write(webidls.close())
@@ -465,16 +476,20 @@ class RecursiveMakeBackend(CommonBackend
         # The Makefile can't regenerate itself because of custom substitution.
         # We need to list it here to ensure changes cause regeneration.
         self.backend_input_files.add(os.path.join(self.environment.topsrcdir,
             'config', 'makefiles', 'xpidl', 'Makefile.in'))
 
     def _process_program(self, program, backend_file):
         backend_file.write('PROGRAM = %s\n' % program)
 
+    def _process_webidl_basename(self, basename):
+        header = 'mozilla/dom/%sBinding.h' % os.path.splitext(basename)[0]
+        self._install_manifests['dist_include'].add_optional_exists(header)
+
     def _process_xpcshell_manifests(self, obj, backend_file, namespace=""):
         manifest = obj.xpcshell_manifests
         backend_file.write('XPCSHELL_TESTS += %s\n' % os.path.dirname(manifest))
         if obj.relativedir != '':
             manifest = '%s/%s' % (obj.relativedir, manifest)
         self.xpcshell_manifests.append(manifest)
 
     def _process_local_include(self, local_include, backend_file):
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -188,16 +188,28 @@ class WebIDLFile(SandboxDerived):
         'basename',
     )
 
     def __init__(self, sandbox, path):
         SandboxDerived.__init__(self, sandbox)
 
         self.basename = path
 
+class GeneratedEventWebIDLFile(SandboxDerived):
+    """Describes an individual .webidl source file."""
+
+    __slots__ = (
+        'basename',
+    )
+
+    def __init__(self, sandbox, path):
+        SandboxDerived.__init__(self, sandbox)
+
+        self.basename = path
+
 class TestWebIDLFile(SandboxDerived):
     """Describes an individual test-only .webidl source file."""
 
     __slots__ = (
         'basename',
     )
 
     def __init__(self, sandbox, path):
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -10,16 +10,17 @@ import os
 from mach.mixin.logging import LoggingMixin
 
 import mozpack.path as mozpath
 
 from .data import (
     ConfigFileSubstitution,
     DirectoryTraversal,
     Exports,
+    GeneratedEventWebIDLFile,
     GeneratedWebIDLFile,
     IPDLFile,
     LocalInclude,
     PreprocessedWebIDLFile,
     Program,
     ReaderSummary,
     TestWebIDLFile,
     VariablePassthru,
@@ -173,16 +174,19 @@ class TreeMetadataEmitter(LoggingMixin):
             yield IPDLFile(sandbox, ipdl)
 
         for local_include in sandbox.get('LOCAL_INCLUDES', []):
             yield LocalInclude(sandbox, local_include)
 
         for webidl in sandbox.get('WEBIDL_FILES', []):
             yield WebIDLFile(sandbox, webidl)
 
+        for webidl in sandbox.get('GENERATED_EVENTS_WEBIDL_FILES', []):
+            yield GeneratedEventWebIDLFile(sandbox, webidl)
+
         for webidl in sandbox.get('TEST_WEBIDL_FILES', []):
             yield TestWebIDLFile(sandbox, webidl)
 
         for webidl in sandbox.get('PREPROCESSED_WEBIDL_FILES', []):
             yield PreprocessedWebIDLFile(sandbox, webidl)
 
         for webidl in sandbox.get('GENERATED_WEBIDL_FILES', []):
             yield GeneratedWebIDLFile(sandbox, webidl)
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -394,16 +394,22 @@ VARIABLES = {
         """),
 
     'WEBIDL_FILES': (list, list, [],
         """WebIDL source files.
 
         These will be parsed and converted to .cpp and .h files.
         """),
 
+    'GENERATED_EVENTS_WEBIDL_FILES': (StrictOrderingOnAppendList, list, [],
+        """WebIDL source files for generated events.
+
+        These will be parsed and converted to .cpp and .h files.
+        """),
+
     'TEST_WEBIDL_FILES': (StrictOrderingOnAppendList, list, [],
          """Test WebIDL source files.
 
          These will be parsed and converted to .cpp and .h files if tests are
          enabled.
          """),
 
     'GENERATED_WEBIDL_FILES': (StrictOrderingOnAppendList, list, [],
--- a/python/mozbuild/mozbuild/makeutil.py
+++ b/python/mozbuild/mozbuild/makeutil.py
@@ -10,67 +10,79 @@ from collections import Iterable
 class Makefile(object):
     '''Provides an interface for writing simple makefiles
 
     Instances of this class are created, populated with rules, then
     written.
     '''
 
     def __init__(self):
-        self._rules = []
+        self._statements = []
 
     def create_rule(self, targets=[]):
         '''
         Create a new rule in the makefile for the given targets.
         Returns the corresponding Rule instance.
         '''
         rule = Rule(targets)
-        self._rules.append(rule)
+        self._statements.append(rule)
         return rule
 
+    def add_statement(self, statement):
+        '''
+        Add a raw statement in the makefile. Meant to be used for
+        simple variable assignments.
+        '''
+        self._statements.append(statement)
+
     def dump(self, fh, removal_guard=True):
         '''
         Dump all the rules to the given file handle. Optionally (and by
         default), add guard rules for file removals (empty rules for other
         rules' dependencies)
         '''
         all_deps = set()
         all_targets = set()
-        for rule in self._rules:
-            rule.dump(fh)
-            all_deps.update(rule.dependencies())
-            all_targets.update(rule.targets())
+        for statement in self._statements:
+            if isinstance(statement, Rule):
+                statement.dump(fh)
+                all_deps.update(statement.dependencies())
+                all_targets.update(statement.targets())
+            else:
+                fh.write('%s\n' % statement)
         if removal_guard:
-            guard = Rule(all_deps - all_targets)
+            guard = Rule(sorted(all_deps - all_targets))
             guard.dump(fh)
 
 
 class Rule(object):
     '''Class handling simple rules in the form:
            target1 target2 ... : dep1 dep2 ...
                    command1
                    command2
                    ...
     '''
     def __init__(self, targets=[]):
-        self._targets = set()
-        self._dependencies = set()
+        self._targets = []
+        self._dependencies = []
         self._commands = []
         self.add_targets(targets)
 
     def add_targets(self, targets):
         '''Add additional targets to the rule.'''
         assert isinstance(targets, Iterable) and not isinstance(targets, StringTypes)
-        self._targets.update(t.replace(os.sep, '/') for t in targets)
+        self._targets.extend(t.replace(os.sep, '/') for t in targets
+                             if not t in self._targets)
         return self
 
     def add_dependencies(self, deps):
         '''Add dependencies to the rule.'''
         assert isinstance(deps, Iterable) and not isinstance(deps, StringTypes)
-        self._dependencies.update(d.replace(os.sep, '/') for d in deps)
+        self._dependencies.extend(d.replace(os.sep, '/') for d in deps
+                                  if not d in self._dependencies)
         return self
 
     def add_commands(self, commands):
         '''Add commands to the rule.'''
         assert isinstance(commands, Iterable) and not isinstance(commands, StringTypes)
         self._commands.extend(commands)
         return self
 
@@ -89,14 +101,14 @@ class Rule(object):
         return iter(self._commands)
 
     def dump(self, fh):
         '''
         Dump the rule to the given file handle.
         '''
         if not self._targets:
             return
-        fh.write('%s:' % ' '.join(sorted(self._targets)))
+        fh.write('%s:' % ' '.join(self._targets))
         if self._dependencies:
-            fh.write(' %s' % ' '.join(sorted(self._dependencies)))
+            fh.write(' %s' % ' '.join(self._dependencies))
         fh.write('\n')
         for cmd in self._commands:
             fh.write('\t%s\n' % cmd)
--- a/python/mozbuild/mozbuild/test/test_makeutil.py
+++ b/python/mozbuild/mozbuild/test/test_makeutil.py
@@ -17,38 +17,32 @@ class TestMakefile(unittest.TestCase):
         out = StringIO()
         rule = Rule()
         rule.dump(out)
         self.assertEqual(out.getvalue(), '')
         out.truncate(0)
 
         rule.add_targets(['foo', 'bar'])
         rule.dump(out)
-        self.assertEqual(out.getvalue(), 'bar foo:\n')
+        self.assertEqual(out.getvalue(), 'foo bar:\n')
         out.truncate(0)
 
         rule.add_targets(['baz'])
         rule.add_dependencies(['qux', 'hoge', 'piyo'])
         rule.dump(out)
-        self.assertEqual(out.getvalue(), 'bar baz foo: hoge piyo qux\n')
-        out.truncate(0)
-
-        rule.add_targets(['baz'])
-        rule.add_dependencies(['qux', 'hoge', 'piyo'])
-        rule.dump(out)
-        self.assertEqual(out.getvalue(), 'bar baz foo: hoge piyo qux\n')
+        self.assertEqual(out.getvalue(), 'foo bar baz: qux hoge piyo\n')
         out.truncate(0)
 
         rule = Rule(['foo', 'bar'])
         rule.add_dependencies(['baz'])
         rule.add_commands(['echo $@'])
         rule.add_commands(['$(BAZ) -o $@ $<', '$(TOUCH) $@'])
         rule.dump(out)
         self.assertEqual(out.getvalue(),
-            'bar foo: baz\n' +
+            'foo bar: baz\n' +
             '\techo $@\n' +
             '\t$(BAZ) -o $@ $<\n' +
             '\t$(TOUCH) $@\n')
 
     def test_makefile(self):
         out = StringIO()
         mk = Makefile()
         rule = mk.create_rule(['foo'])
@@ -68,16 +62,31 @@ class TestMakefile(unittest.TestCase):
         mk.dump(out)
         self.assertEqual(out.getvalue(),
             'foo: bar baz qux\n' +
             '\techo foo\n' +
             'bar baz: hoge\n' +
             '\techo $@\n' +
             'hoge qux:\n')
 
+    def test_statement(self):
+        out = StringIO()
+        mk = Makefile()
+        mk.create_rule(['foo']).add_dependencies(['bar']) \
+                               .add_commands(['echo foo'])
+        mk.add_statement('BAR = bar')
+        mk.create_rule(['$(BAR)']).add_commands(['echo $@'])
+        mk.dump(out, removal_guard=False)
+        self.assertEqual(out.getvalue(),
+            'foo: bar\n' +
+            '\techo foo\n' +
+            'BAR = bar\n' +
+            '$(BAR):\n' +
+            '\techo $@\n')
+
     @unittest.skipIf(os.name != 'nt', 'Test only applicable on Windows.')
     def test_path_normalization(self):
         out = StringIO()
         mk = Makefile()
         rule = mk.create_rule(['c:\\foo'])
         rule.add_dependencies(['c:\\bar', 'c:\\baz\\qux'])
         rule.add_commands(['echo c:\\foo'])
         mk.dump(out)
--- a/python/virtualenv/AUTHORS.txt
+++ b/python/virtualenv/AUTHORS.txt
@@ -4,55 +4,88 @@ Author
 Ian Bicking
 
 Maintainers
 -----------
 
 Brian Rosner
 Carl Meyer
 Jannis Leidel
+Paul Moore
 Paul Nasrat
+Marcus Smith
 
 Contributors
 ------------
 
 Alex Grönholm
 Anatoly Techtonik
 Antonio Cuni
+Antonio Valentino
 Armin Ronacher
+Barry Warsaw
 Benjamin Root
 Bradley Ayers
 Branden Rolston
+Brandon Carl
+Brian Kearns
 Cap Petschulat
 CBWhiz
+Chris Adams
 Chris McDonough
+Christos Kontas
+Christian Hudon
 Christian Stefanescu
 Christopher Nilsson
 Cliff Xuan
 Curt Micol
 Damien Nozay
+Dan Sully
+Daniel Hahler
+Daniel Holth
 David Schoonover
+Denis Costa
 Doug Hellmann
 Doug Napoleone
 Douglas Creager
+Eduard-Cristian Stefan
+Erik M. Bray
 Ethan Jucovy
 Gabriel de Perthuis
 Gunnlaugur Thor Briem
+Graham Dennis
 Greg Haskins
+Jason Penney
 Jason R. Coombs
 Jeff Hammel
 Jeremy Orem
+Jason Penney
+Jason R. Coombs
+John Kleint
 Jonathan Griffin
+Jonathan Hitchcock
 Jorge Vargas
 Josh Bronson
+Kamil Kisiel
+Kyle Gibson
 Konstantin Zemlyak
 Kumar McMillan
 Lars Francke
 Marc Abramowitz
+Mika Laitio
 Mike Hommey
 Miki Tebeka
-Paul Moore
 Philip Jenvey
+Philippe Ombredanne
+Piotr Dobrogost
+Preston Holmes
+Ralf Schmitt
 Raul Leal
 Ronny Pfannschmidt
+Satrajit Ghosh
+Sergio de Carvalho
 Stefano Rivera
 Tarek Ziadé
+Thomas Aglassinger
 Vinay Sajip
+Vitaly Babiy
+Vladimir Rutsky
+Wang Xuerui
\ No newline at end of file
--- a/python/virtualenv/LICENSE.txt
+++ b/python/virtualenv/LICENSE.txt
@@ -1,11 +1,11 @@
 Copyright (c) 2007 Ian Bicking and Contributors
 Copyright (c) 2009 Ian Bicking, The Open Planning Project
-Copyright (c) 2011-2012 The virtualenv developers
+Copyright (c) 2011-2013 The virtualenv developers
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
 "Software"), to deal in the Software without restriction, including
 without limitation the rights to use, copy, modify, merge, publish,
 distribute, sublicense, and/or sell copies of the Software, and to
 permit persons to whom the Software is furnished to do so, subject to
 the following conditions:
--- a/python/virtualenv/PKG-INFO
+++ b/python/virtualenv/PKG-INFO
@@ -1,112 +1,159 @@
 Metadata-Version: 1.1
 Name: virtualenv
-Version: 1.8.4
+Version: 1.10.1
 Summary: Virtual Python Environment builder
 Home-page: http://www.virtualenv.org
 Author: Jannis Leidel, Carl Meyer and Brian Rosner
 Author-email: python-virtualenv@groups.google.com
 License: MIT
 Description: 
         
-        Installation
-        ------------
-        
-        You can install virtualenv with ``pip install virtualenv``, or the `latest
-        development version <https://github.com/pypa/virtualenv/tarball/develop>`_
-        with ``pip install https://github.com/pypa/virtualenv/tarball/develop``.
-        
-        You can also use ``easy_install``, or if you have no Python package manager
-        available at all, you can just grab the single file `virtualenv.py`_ and run
-        it with ``python virtualenv.py``.
-        
-        .. _virtualenv.py: https://raw.github.com/pypa/virtualenv/master/virtualenv.py
-        
         What It Does
         ------------
         
         ``virtualenv`` is a tool to create isolated Python environments.
         
         The basic problem being addressed is one of dependencies and versions,
-        and indirectly permissions.  Imagine you have an application that
+        and indirectly permissions. Imagine you have an application that
         needs version 1 of LibFoo, but another application requires version
-        2.  How can you use both these applications?  If you install
+        2. How can you use both these applications?  If you install
         everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
         platform's standard location is), it's easy to end up in a situation
         where you unintentionally upgrade an application that shouldn't be
         upgraded.
         
         Or more generally, what if you want to install an application *and
         leave it be*?  If an application works, any change in its libraries or
         the versions of those libraries can break the application.
         
         Also, what if you can't install packages into the global
         ``site-packages`` directory?  For instance, on a shared host.
         
-        In all these cases, ``virtualenv`` can help you.  It creates an
+        In all these cases, ``virtualenv`` can help you. It creates an
         environment that has its own installation directories, that doesn't
         share libraries with other virtualenv environments (and optionally
         doesn't access the globally installed libraries either).
         
+        
+        Installation
+        ------------
+        
+        .. warning::
+        
+            We advise installing virtualenv-1.9 or greater. Prior to version 1.9, the
+            pip included in virtualenv did not not download from PyPI over SSL.
+        
+        .. warning::
+        
+            When using pip to install virtualenv, we advise using pip 1.3 or greater.
+            Prior to version 1.3, pip did not not download from PyPI over SSL.
+        
+        .. warning::
+        
+            We advise against using easy_install to install virtualenv when using
+            setuptools < 0.9.7, because easy_install didn't download from PyPI over SSL
+            and was broken in some subtle ways.
+        
+        To install globally with `pip` (if you have pip 1.3 or greater installed globally):
+        
+        ::
+        
+         $ [sudo] pip install virtualenv
+        
+        Or to get the latest unreleased dev version:
+        
+        ::
+        
+         $ [sudo] pip install https://github.com/pypa/virtualenv/tarball/develop
+        
+        
+        To install globally from source:
+        
+        ::
+        
+         $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
+         $ tar xvfz virtualenv-X.X.tar.gz
+         $ cd virtualenv-X.X
+         $ [sudo] python setup.py install
+        
+        
+        To *use* locally from source:
+        
+        ::
+        
+         $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
+         $ tar xvfz virtualenv-X.X.tar.gz
+         $ cd virtualenv-X.X
+         $ python virtualenv.py myVE
+        
+        .. note::
+        
+            The ``virtualenv.py`` script is *not* supported if run without the
+            necessary pip/setuptools/virtualenv distributions available locally. All
+            of the installation methods above include a ``virtualenv_support``
+            directory alongside ``virtualenv.py`` which contains a complete set of
+            pip and setuptools distributions, and so are fully supported.
+        
         Usage
         -----
         
         The basic usage is::
         
-            $ python virtualenv.py ENV
-        
-        If you install it you can also just do ``virtualenv ENV``.
+            $ virtualenv ENV
         
         This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
-        install will go.  It also creates ``ENV/bin/python``, which is a Python
-        interpreter that uses this environment.  Anytime you use that interpreter
+        install will go. It also creates ``ENV/bin/python``, which is a Python
+        interpreter that uses this environment. Anytime you use that interpreter
         (including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
         in that environment will be used.
         
         It also installs either `Setuptools
-        <http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
-        <http://pypi.python.org/pypi/distribute>`_ into the environment. To use
-        Distribute instead of setuptools, just call virtualenv like this::
+        <http://peak.telecommunity.com/DevCenter/setuptools>`_ into the environment.
+        
+        .. note::
         
-            $ python virtualenv.py --distribute ENV
-        
-        You can also set the environment variable VIRTUALENV_DISTRIBUTE.
+          Virtualenv (<1.10) used to provide a ``--distribute`` option to use the
+          setuptools fork Distribute_. Since Distribute has been merged back into
+          setuptools this option is now no-op, it will always use the improved
+          setuptools releases.
         
         A new virtualenv also includes the `pip <http://pypi.python.org/pypi/pip>`_
         installer, so you can use ``ENV/bin/pip`` to install additional packages into
         the environment.
         
+        .. _Distribute: https://pypi.python.org/pypi/distribute
         
         activate script
         ~~~~~~~~~~~~~~~
         
         In a newly created virtualenv there will be a ``bin/activate`` shell
         script. For Windows systems, activation scripts are provided for CMD.exe
         and Powershell.
         
         On Posix systems you can do::
         
             $ source bin/activate
         
         This will change your ``$PATH`` so its first entry is the virtualenv's
-        ``bin/`` directory.  (You have to use ``source`` because it changes your
+        ``bin/`` directory. (You have to use ``source`` because it changes your
         shell environment in-place.) This is all it does; it's purely a
-        convenience.  If you directly run a script or the python interpreter
-        from the virtualenv's ``bin/`` directory (e.g.  ``path/to/env/bin/pip``
+        convenience. If you directly run a script or the python interpreter
+        from the virtualenv's ``bin/`` directory (e.g. ``path/to/env/bin/pip``
         or ``/path/to/env/bin/python script.py``) there's no need for
         activation.
         
         After activating an environment you can use the function ``deactivate`` to
         undo the changes to your ``$PATH``.
         
         The ``activate`` script will also modify your shell prompt to indicate
-        which environment is currently active.  You can disable this behavior,
+        which environment is currently active. You can disable this behavior,
         which can be useful if you have your own custom prompt that already
-        displays the active environment name.  To do so, set the
+        displays the active environment name. To do so, set the
         ``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
         value before running the ``activate`` script.
         
         On Windows you just do::
         
             > \path\to\env\Scripts\activate
         
         And type `deactivate` to undo the changes.
@@ -170,64 +217,64 @@ Description:
         The ``--system-site-packages`` Option
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         
         If you build with ``virtualenv --system-site-packages ENV``, your virtual
         environment will inherit packages from ``/usr/lib/python2.7/site-packages``
         (or wherever your global site-packages directory is).
         
         This can be used if you have control over the global site-packages directory,
-        and you want to depend on the packages there.  If you want isolation from the
+        and you want to depend on the packages there. If you want isolation from the
         global system, do not use this flag.
         
         
         Environment variables and configuration files
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         
         virtualenv can not only be configured by passing command line options such as
-        ``--distribute`` but also by two other means:
+        ``--python`` but also by two other means:
         
         - Environment variables
         
           Each command line option is automatically used to look for environment
           variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
           the name of the command line options are capitalized and have dashes
           (``'-'``) replaced with underscores (``'_'``).
         
-          For example, to automatically install Distribute instead of setuptools
-          you can also set an environment variable::
+          For example, to automatically use a custom Python binary instead of the
+          one virtualenv is run with you can also set an environment variable::
         
-              $ export VIRTUALENV_DISTRIBUTE=true
-              $ python virtualenv.py ENV
+              $ export VIRTUALENV_PYTHON=/opt/python-3.3/bin/python
+              $ virtualenv ENV
         
           It's the same as passing the option to virtualenv directly::
         
-              $ python virtualenv.py --distribute ENV
+              $ virtualenv --python=/opt/python-3.3/bin/python ENV
         
           This also works for appending command line options, like ``--find-links``.
           Just leave an empty space between the passsed values, e.g.::
         
               $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
               $ virtualenv ENV
         
           is the same as calling::
         
-              $ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
+              $ virtualenv --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
         
         - Config files
         
           virtualenv also looks for a standard ini config file. On Unix and Mac OS X
           that's ``$HOME/.virtualenv/virtualenv.ini`` and on Windows, it's
           ``%APPDATA%\virtualenv\virtualenv.ini``.
         
           The names of the settings are derived from the long command line option,
-          e.g. the option ``--distribute`` would look like this::
+          e.g. the option ``--python`` would look like this::
         
               [virtualenv]
-              distribute = true
+              python = /opt/python-3.3/bin/python
         
           Appending options like ``--extra-search-dir`` can be written on multiple
           lines::
         
               [virtualenv]
               extra-search-dir =
                   /path/to/dists
                   /path/to/other/dists
@@ -251,47 +298,47 @@ Description:
         Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
         supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
         To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
         
         Creating Your Own Bootstrap Scripts
         -----------------------------------
         
         While this creates an environment, it doesn't put anything into the
-        environment.  Developers may find it useful to distribute a script
+        environment. Developers may find it useful to distribute a script
         that sets up a particular environment, for example a script that
         installs a particular web application.
         
         To create a script like this, call
         ``virtualenv.create_bootstrap_script(extra_text)``, and write the
-        result to your new bootstrapping script.  Here's the documentation
+        result to your new bootstrapping script. Here's the documentation
         from the docstring:
         
         Creates a bootstrap script, which is like this script but with
         extend_parser, adjust_options, and after_install hooks.
         
         This returns a string that (written to disk of course) can be used
-        as a bootstrap script with your own customizations.  The script
+        as a bootstrap script with your own customizations. The script
         will be the standard virtualenv.py script, with your extra text
         added (your extra text should be Python code).
         
         If you include these functions, they will be called:
         
         ``extend_parser(optparse_parser)``:
             You can add or remove options from the parser here.
         
         ``adjust_options(options, args)``:
             You can change options here, or change the args (if you accept
             different kinds of arguments, be sure you modify ``args`` so it is
             only ``[DEST_DIR]``).
         
         ``after_install(options, home_dir)``:
         
-            After everything is installed, this function is called.  This
-            is probably the function you are most likely to use.  An
+            After everything is installed, this function is called. This
+            is probably the function you are most likely to use. An
             example would be::
         
                 def after_install(options, home_dir):
                     if sys.platform == 'win32':
                         bin = 'Scripts'
                     else:
                         bin = 'bin'
                     subprocess.call([join(home_dir, bin, 'easy_install'),
@@ -327,158 +374,156 @@ Description:
         Another example is available `here
         <https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py>`_.
         
         
         Using Virtualenv without ``bin/python``
         ---------------------------------------
         
         Sometimes you can't or don't want to use the Python interpreter
-        created by the virtualenv.  For instance, in a `mod_python
+        created by the virtualenv. For instance, in a `mod_python
         <http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
         environment, there is only one interpreter.
         
-        Luckily, it's easy.  You must use the custom Python interpreter to
-        *install* libraries.  But to *use* libraries, you just have to be sure
-        the path is correct.  A script is available to correct the path.  You
+        Luckily, it's easy. You must use the custom Python interpreter to
+        *install* libraries. But to *use* libraries, you just have to be sure
+        the path is correct. A script is available to correct the path. You
         can setup the environment like::
         
             activate_this = '/path/to/env/bin/activate_this.py'
             execfile(activate_this, dict(__file__=activate_this))
         
         This will change ``sys.path`` and even change ``sys.prefix``, but also allow
-        you to use an existing interpreter.  Items in your environment will show up
-        first on ``sys.path``, before global items.  However, global items will
+        you to use an existing interpreter. Items in your environment will show up
+        first on ``sys.path``, before global items. However, global items will
         always be accessible (as if the ``--system-site-packages`` flag had been used
-        in creating the environment, whether it was or not).  Also, this cannot undo
+        in creating the environment, whether it was or not). Also, this cannot undo
         the activation of other environments, or modules that have been imported.
         You shouldn't try to, for instance, activate an environment before a web
         request; you should activate *one* environment as early as possible, and not
         do it again in that process.
         
         Making Environments Relocatable
         -------------------------------
         
         Note: this option is somewhat experimental, and there are probably
-        caveats that have not yet been identified.  Also this does not
-        currently work on Windows.
+        caveats that have not yet been identified.
+        
+        .. warning::
         
-        Normally environments are tied to a specific path.  That means that
+            The ``--relocatable`` option currently has a number of issues,
+            and is not guaranteed to work in all circumstances. It is possible
+            that the option will be deprecated in a future version of ``virtualenv``.
+        
+        Normally environments are tied to a specific path. That means that
         you cannot move an environment around or copy it to another computer.
         You can fix up an environment to make it relocatable with the
         command::
         
             $ virtualenv --relocatable ENV
         
-        This will make some of the files created by setuptools or distribute
-        use relative paths, and will change all the scripts to use ``activate_this.py``
-        instead of using the location of the Python interpreter to select the
-        environment.
+        This will make some of the files created by setuptools use relative paths,
+        and will change all the scripts to use ``activate_this.py`` instead of using
+        the location of the Python interpreter to select the environment.
+        
+        **Note:** scripts which have been made relocatable will only work if
+        the virtualenv is activated, specifically the python executable from
+        the virtualenv must be the first one on the system PATH. Also note that
+        the activate scripts are not currently made relocatable by
+        ``virtualenv --relocatable``.
         
         **Note:** you must run this after you've installed *any* packages into
-        the environment.  If you make an environment relocatable, then
+        the environment. If you make an environment relocatable, then
         install a new package, you must run ``virtualenv --relocatable``
         again.
         
-        Also, this **does not make your packages cross-platform**.  You can
+        Also, this **does not make your packages cross-platform**. You can
         move the directory around, but it can only be used on other similar
-        computers.  Some known environmental differences that can cause
+        computers. Some known environmental differences that can cause
         incompatibilities: a different version of Python, when one platform
         uses UCS2 for its internal unicode representation and another uses
         UCS4 (a compile-time option), obvious platform changes like Windows
         vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
         libraries on the system, if those C libraries are located somewhere
         different (either different versions, or a different filesystem
         layout).
         
         If you use this flag to create an environment, currently, the
         ``--system-site-packages`` option will be implied.
         
         The ``--extra-search-dir`` option
         ---------------------------------
         
-        When it creates a new environment, virtualenv installs either setuptools
-        or distribute, and pip.  In normal operation when virtualenv is
-        installed, the bundled version of these packages included in the
-        ``virtualenv_support`` directory is used. When ``virtualenv.py`` is run
-        standalone and ``virtualenv_support`` is not available, the latest
-        releases of these packages are fetched from the `Python Package Index
-        <http://pypi.python.org>`_ (PyPI).
+        .. note::
+        
+            Currently, this feature only partially works for pip, and not at
+            all for setuptools. For details,
+            see `Issue #327 <https://github.com/pypa/virtualenv/issues/327>`_
         
-        As an alternative, you can provide your own versions of setuptools,
-        distribute and/or pip on the filesystem, and tell virtualenv to use
-        those distributions instead of downloading them from the Internet.  To
-        use this feature, pass one or more ``--extra-search-dir`` options to
+        This option allows you to provide your own versions of setuptools
+        and/or pip on the filesystem, and tell virtualenv to use those distributions
+        instead of the ones in ``virtualenv_support``.
+        
+        To use this feature, pass one or more ``--extra-search-dir`` options to
         virtualenv like this::
         
             $ virtualenv --extra-search-dir=/path/to/distributions ENV
         
         The ``/path/to/distributions`` path should point to a directory that
-        contains setuptools, distribute and/or pip distributions.  Setuptools
-        distributions must be ``.egg`` files; pip distributions should be
-        `.tar.gz` source distributions, and distribute distributions may be
-        either (if found an egg will be used preferentially).
+        contains setuptools and/or pip distributions. Setuptools distributions
+        must be ``.egg`` files; pip distributions should be `.tar.gz` source
+        distributions.
         
-        Virtualenv will still download these packages if no satisfactory local
-        distributions are found.
-        
-        If you are really concerned about virtualenv fetching these packages
-        from the Internet and want to ensure that it never will, you can also
-        provide an option ``--never-download`` like so::
-        
-            $ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV
+        If no satisfactory local distributions are found, virtualenv will fail. Virtualenv will never download packages.
         
-        If this option is provided, virtualenv will never try to download
-        setuptools/distribute or pip. Instead, it will exit with status code 1
-        if it fails to find local distributions for any of these required
-        packages. The local distribution lookup is done in the following
-        locations, with the most recent version found used:
+        The distribution lookup is done in the following locations, with the most
+        recent version found used:
         
-            #. The current directory.
-            #. The directory where virtualenv.py is located.
-            #. A ``virtualenv_support`` directory relative to the directory where
-               virtualenv.py is located.
-            #. If the file being executed is not named virtualenv.py (i.e. is a boot
-               script), a ``virtualenv_support`` directory relative to wherever
-               virtualenv.py is actually installed.
+        #. The current directory.
+        #. The directory where virtualenv.py is located.
+        #. A ``virtualenv_support`` directory relative to the directory where
+           virtualenv.py is located.
+        #. If the file being executed is not named virtualenv.py (i.e. is a boot
+           script), a ``virtualenv_support`` directory relative to wherever
+           virtualenv.py is actually installed.
         
         
         Compare & Contrast with Alternatives
         ------------------------------------
         
         There are several alternatives that create isolated environments:
         
         * ``workingenv`` (which I do not suggest you use anymore) is the
-          predecessor to this library.  It used the main Python interpreter,
+          predecessor to this library. It used the main Python interpreter,
           but relied on setting ``$PYTHONPATH`` to activate the environment.
           This causes problems when running Python scripts that aren't part of
-          the environment (e.g., a globally installed ``hg`` or ``bzr``).  It
+          the environment (e.g., a globally installed ``hg`` or ``bzr``). It
           also conflicted a lot with Setuptools.
         
         * `virtual-python
           <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
-          is also a predecessor to this library.  It uses only symlinks, so it
-          couldn't work on Windows.  It also symlinks over the *entire*
-          standard library and global ``site-packages``.  As a result, it
+          is also a predecessor to this library. It uses only symlinks, so it
+          couldn't work on Windows. It also symlinks over the *entire*
+          standard library and global ``site-packages``. As a result, it
           won't see new additions to the global ``site-packages``.
         
           This script only symlinks a small portion of the standard library
           into the environment, and so on Windows it is feasible to simply
-          copy these files over.  Also, it creates a new/empty
+          copy these files over. Also, it creates a new/empty
           ``site-packages`` and also adds the global ``site-packages`` to the
-          path, so updates are tracked separately.  This script also installs
+          path, so updates are tracked separately. This script also installs
           Setuptools automatically, saving a step and avoiding the need for
           network access.
         
         * `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
           create an isolated Python environment in the same style, but
           achieves similar results through a declarative config file that sets
-          up scripts with very particular packages.  As a declarative system,
+          up scripts with very particular packages. As a declarative system,
           it is somewhat easier to repeat and manage, but more difficult to
-          experiment with.  ``zc.buildout`` includes the ability to setup
+          experiment with. ``zc.buildout`` includes the ability to setup
           non-Python systems (e.g., a database server or an Apache instance).
         
         I *strongly* recommend anyone doing application development or
         deployment use one of these tools.
         
         Contributing
         ------------
         
@@ -534,17 +579,17 @@ Description:
         
         * `Blog announcement
           <http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
         
         * Doug Hellmann wrote a description of his `command-line work flow
           using virtualenv (virtualenvwrapper)
           <http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
           including some handy scripts to make working with multiple
-          environments easier.  He also wrote `an example of using virtualenv
+          environments easier. He also wrote `an example of using virtualenv
           to try IPython
           <http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
         
         * Chris Perkins created a `showmedo video including virtualenv
           <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
         
         * `Using virtualenv with mod_wsgi
           <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
@@ -578,28 +623,93 @@ Description:
            2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to
            the fact that a virtualenv uses the system Python's standard library but
            contains its own copy of the Python interpreter, so an upgrade to the system
            Python results in a mismatch between the version of the Python interpreter
            and the version of the standard library. It can be fixed by removing
            ``$ENV/bin/python`` and re-running virtualenv on the same target directory
            with the upgraded Python.
         
+        1.10.1 (2013-08-07)
+        ~~~~~~~~~~~~~~~~~~~
+        
+        * **New Signing Key** Release 1.10.1 is using a different key than normal with
+          fingerprint: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
+        * Upgraded pip to v1.4.1
+        * Upgraded setuptools to v0.9.8
+        
+        
+        1.10 (2013-07-23)
+        ~~~~~~~~~~~~~~~~~
+        
+        * **BACKWARDS INCOMPATIBLE** Dropped support for Python 2.5. The minimum
+          supported Python version is now Python 2.6.
+        
+        * **BACKWARDS INCOMPATIBLE** Using ``virtualenv.py`` as an isolated script
+          (i.e. without an associated ``virtualenv_support`` directory) is no longer
+          supported for security reasons and will fail with an error.
+        
+          Along with this, ``--never-download`` is now always pinned to ``True``, and
+          is only being maintained in the short term for backward compatibility
+          (Pull #412).
+        
+        * **IMPORTANT** Switched to the new setuptools (v0.9.7) which has been merged
+          with Distribute_ again and works for Python 2 and 3 with one codebase.
+          The ``--distribute`` and ``--setuptools`` options are now no-op.
+        
+        * Updated to pip 1.4.
+        
+        * Added support for PyPy3k
+        
+        * Added the option to use a version number with the ``-p`` option to get the
+          system copy of that Python version (Windows only)
+        
+        * Removed embedded ``ez_setup.py``, ``distribute_setup.py`` and
+          ``distribute_from_egg.py`` files as part of switching to merged setuptools.
+        
+        * Fixed ``--relocatable`` to work better on Windows.
+        
+        * Fixed issue with readline on Windows.
+        
+        .. _Distribute: https://pypi.python.org/pypi/distribute
+        
+        1.9.1 (2013-03-08)
+        ~~~~~~~~~~~~~~~~~~
+        
+        * Updated to pip 1.3.1 that fixed a major backward incompatible change of
+          parsing URLs to externally hosted packages that got accidentily included
+          in pip 1.3.
+        
+        1.9 (2013-03-07)
+        ~~~~~~~~~~~~~~~~
+        
+        * Unset VIRTUAL_ENV environment variable in deactivate.bat (Pull #364)
+        * Upgraded distribute to 0.6.34.
+        * Added ``--no-setuptools`` and ``--no-pip`` options (Pull #336).
+        * Fixed Issue #373. virtualenv-1.8.4 was failing in cygwin (Pull #382).
+        * Fixed Issue #378. virtualenv is now "multiarch" aware on debian/ubuntu (Pull #379).
+        * Fixed issue with readline module path on pypy and OSX (Pull #374).
+        * Made 64bit detection compatible with Python 2.5 (Pull #393).
+        
+        
         1.8.4 (2012-11-25)
         ~~~~~~~~~~~~~~~~~~
         
         * Updated distribute to 0.6.31. This fixes #359 (numpy install regression) on
           UTF-8 platforms, and provides a workaround on other platforms:
           ``PYTHONIOENCODING=utf8 pip install numpy``.
         
         * When installing virtualenv via curl, don't forget to filter out arguments
           the distribute setup script won't understand. Fixes #358.
         
         * Added some more integration tests.
         
+        * Removed the unsupported embedded setuptools egg for Python 2.4 to reduce
+          file size.
+        
         1.8.3 (2012-11-21)
         ~~~~~~~~~~~~~~~~~~
         
         * Fixed readline on OS X. Thanks minrk
         
         * Updated distribute to 0.6.30 (improves our error reporting, plus new
           distribute features and fixes). Thanks Gabriel (g2p)
         
@@ -1191,17 +1301,17 @@ Description:
         
         0.8
         ~~~
         
         Initial release.  Everything is changed and new!
         
 Keywords: setuptools deployment installation distutils
 Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
 Classifier: Intended Audience :: Developers
 Classifier: License :: OSI Approved :: MIT License
 Classifier: Programming Language :: Python :: 2
 Classifier: Programming Language :: Python :: 2.5
 Classifier: Programming Language :: Python :: 2.6
 Classifier: Programming Language :: Python :: 2.7
 Classifier: Programming Language :: Python :: 3
 Classifier: Programming Language :: Python :: 3.1
--- a/python/virtualenv/README.rst
+++ b/python/virtualenv/README.rst
@@ -1,7 +1,10 @@
 virtualenv
 ==========
 
+.. image:: https://pypip.in/v/virtualenv/badge.png
+        :target: https://pypi.python.org/pypi/virtualenv
+
 .. image:: https://secure.travis-ci.org/pypa/virtualenv.png?branch=develop
    :target: http://travis-ci.org/pypa/virtualenv
 
 For documentation, see http://www.virtualenv.org/
deleted file mode 100755
--- a/python/virtualenv/bin/refresh-support-files.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-"""
-Refresh any files in ../virtualenv_support/ that come from elsewhere
-"""
-
-import os
-try:
-    from urllib.request import urlopen
-except ImportError:
-    from urllib2 import urlopen
-import sys
-
-here = os.path.dirname(__file__)
-support_location = os.path.join(here, '..', 'virtualenv_support')
-embedded_location = os.path.join(here, '..', 'virtualenv_embedded')
-
-embedded_files = [
-    ('http://peak.telecommunity.com/dist/ez_setup.py', 'ez_setup.py'),
-    ('http://python-distribute.org/distribute_setup.py', 'distribute_setup.py'),
-]
-
-support_files = [
-    ('http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg', 'setuptools-0.6c11-py2.6.egg'),
-    ('http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg', 'setuptools-0.6c11-py2.5.egg'),
-    ('http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz', 'distribute-0.6.31.tar.gz'),
-    ('http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz', 'pip-1.2.1.tar.gz'),
-]
-
-
-def refresh_files(files, location):
-    for url, filename in files:
-        sys.stdout.write('fetching %s ... ' % url)
-        sys.stdout.flush()
-        f = urlopen(url)
-        content = f.read()
-        f.close()
-        print('done.')
-        filename = os.path.join(location, filename)
-        if os.path.exists(filename):
-            f = open(filename, 'rb')
-            cur_content = f.read()
-            f.close()
-        else:
-            cur_content = ''
-        if cur_content == content:
-            print('  %s up-to-date' % filename)
-        else:
-            print('  overwriting %s' % filename)
-            f = open(filename, 'wb')
-            f.write(content)
-            f.close()
-
-
-def main():
-    refresh_files(embedded_files, embedded_location)
-    refresh_files(support_files, support_location)
-
-if __name__ == '__main__':
-    main()
--- a/python/virtualenv/docs/conf.py
+++ b/python/virtualenv/docs/conf.py
@@ -6,41 +6,42 @@
 # This file is execfile()d with the current directory set to its containing dir.
 #
 # The contents of this file are pickled, so don't put values in the namespace
 # that aren't pickleable (module imports are okay, they're removed automatically).
 #
 # All configuration values have a default value; values that are commented out
 # serve to show the default value.
 
+import os
 import sys
 
 # If your extensions are in another directory, add it here.
-#sys.path.append('some/directory')
+sys.path.insert(0, os.path.abspath(os.pardir))
 
 # General configuration
 # ---------------------
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc']
 
 # Add any paths that contain templates here, relative to this directory.
 ## FIXME: disabled for now because I haven't figured out how to use this:
 #templates_path = ['_templates']
 
 # The suffix of source filenames.
-source_suffix = '.txt'
+source_suffix = '.rst'
 
 # The master toctree document.
 master_doc = 'index'
 
 # General substitutions.
 project = 'virtualenv'
-copyright = '2007-2012, Ian Bicking, The Open Planning Project, The virtualenv developers'
+copyright = '2007-2013, Ian Bicking, The Open Planning Project, The virtualenv developers'
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
 try:
     from virtualenv import __version__
     # The short X.Y version.
     version = '.'.join(__version__.split('.')[:2])
     # The full version, including alpha/beta/rc tags.
new file mode 100644
--- /dev/null
+++ b/python/virtualenv/docs/index.rst
@@ -0,0 +1,615 @@
+virtualenv
+==========
+
+`Changes & News <news.html>`_ `|`
+`Mailing list <http://groups.google.com/group/python-virtualenv>`_ `|`
+`Issues <https://github.com/pypa/virtualenv/issues>`_ `|`
+`Github <https://github.com/pypa/virtualenv>`_ `|`
+`PyPI <https://pypi.python.org/pypi/virtualenv/>`_ `|`
+IRC: #pip on Freenode
+
+.. comment: split here
+
+What It Does
+------------
+
+``virtualenv`` is a tool to create isolated Python environments.
+
+The basic problem being addressed is one of dependencies and versions,
+and indirectly permissions. Imagine you have an application that
+needs version 1 of LibFoo, but another application requires version
+2. How can you use both these applications?  If you install
+everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
+platform's standard location is), it's easy to end up in a situation
+where you unintentionally upgrade an application that shouldn't be
+upgraded.
+
+Or more generally, what if you want to install an application *and
+leave it be*?  If an application works, any change in its libraries or
+the versions of those libraries can break the application.
+
+Also, what if you can't install packages into the global
+``site-packages`` directory?  For instance, on a shared host.
+
+In all these cases, ``virtualenv`` can help you. It creates an
+environment that has its own installation directories, that doesn't
+share libraries with other virtualenv environments (and optionally
+doesn't access the globally installed libraries either).
+
+
+Installation
+------------
+
+.. warning::
+
+    We advise installing virtualenv-1.9 or greater. Prior to version 1.9, the
+    pip included in virtualenv did not not download from PyPI over SSL.
+
+.. warning::
+
+    When using pip to install virtualenv, we advise using pip 1.3 or greater.
+    Prior to version 1.3, pip did not not download from PyPI over SSL.
+
+.. warning::
+
+    We advise against using easy_install to install virtualenv when using
+    setuptools < 0.9.7, because easy_install didn't download from PyPI over SSL
+    and was broken in some subtle ways.
+
+To install globally with `pip` (if you have pip 1.3 or greater installed globally):
+
+::
+
+ $ [sudo] pip install virtualenv
+
+Or to get the latest unreleased dev version:
+
+::
+
+ $ [sudo] pip install https://github.com/pypa/virtualenv/tarball/develop
+
+
+To install globally from source:
+
+::
+
+ $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
+ $ tar xvfz virtualenv-X.X.tar.gz
+ $ cd virtualenv-X.X
+ $ [sudo] python setup.py install
+
+
+To *use* locally from source:
+
+::
+
+ $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
+ $ tar xvfz virtualenv-X.X.tar.gz
+ $ cd virtualenv-X.X
+ $ python virtualenv.py myVE
+
+.. note::
+
+    The ``virtualenv.py`` script is *not* supported if run without the
+    necessary pip/setuptools/virtualenv distributions available locally. All
+    of the installation methods above include a ``virtualenv_support``
+    directory alongside ``virtualenv.py`` which contains a complete set of
+    pip and setuptools distributions, and so are fully supported.
+
+Usage
+-----
+
+The basic usage is::
+
+    $ virtualenv ENV
+
+This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
+install will go. It also creates ``ENV/bin/python``, which is a Python
+interpreter that uses this environment. Anytime you use that interpreter
+(including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
+in that environment will be used.
+
+It also installs either `Setuptools
+<http://peak.telecommunity.com/DevCenter/setuptools>`_ into the environment.
+
+.. note::
+
+  Virtualenv (<1.10) used to provide a ``--distribute`` option to use the
+  setuptools fork Distribute_. Since Distribute has been merged back into
+  setuptools this option is now no-op, it will always use the improved
+  setuptools releases.
+
+A new virtualenv also includes the `pip <http://pypi.python.org/pypi/pip>`_
+installer, so you can use ``ENV/bin/pip`` to install additional packages into
+the environment.
+
+.. _Distribute: https://pypi.python.org/pypi/distribute
+
+activate script
+~~~~~~~~~~~~~~~
+
+In a newly created virtualenv there will be a ``bin/activate`` shell
+script. For Windows systems, activation scripts are provided for CMD.exe
+and Powershell.
+
+On Posix systems you can do::
+
+    $ source bin/activate
+
+This will change your ``$PATH`` so its first entry is the virtualenv's
+``bin/`` directory. (You have to use ``source`` because it changes your
+shell environment in-place.) This is all it does; it's purely a
+convenience. If you directly run a script or the python interpreter
+from the virtualenv's ``bin/`` directory (e.g. ``path/to/env/bin/pip``
+or ``/path/to/env/bin/python script.py``) there's no need for
+activation.
+
+After activating an environment you can use the function ``deactivate`` to
+undo the changes to your ``$PATH``.
+
+The ``activate`` script will also modify your shell prompt to indicate
+which environment is currently active. You can disable this behavior,
+which can be useful if you have your own custom prompt that already
+displays the active environment name. To do so, set the
+``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
+value before running the ``activate`` script.
+
+On Windows you just do::
+
+    > \path\to\env\Scripts\activate
+
+And type `deactivate` to undo the changes.
+
+Based on your active shell (CMD.exe or Powershell.exe), Windows will use
+either activate.bat or activate.ps1 (as appropriate) to activate the
+virtual environment. If using Powershell, see the notes about code signing
+below.
+
+.. note::
+
+    If using Powershell, the ``activate`` script is subject to the
+    `execution policies`_ on the system. By default on Windows 7, the system's
+    excution policy is set to ``Restricted``, meaning no scripts like the
+    ``activate`` script are allowed to be executed. But that can't stop us
+    from changing that slightly to allow it to be executed.
+
+    In order to use the script, you have to relax your system's execution
+    policy to ``AllSigned``, meaning all scripts on the system must be
+    digitally signed to be executed. Since the virtualenv activation
+    script is signed by one of the authors (Jannis Leidel) this level of
+    the execution policy suffices. As an administrator run::
+
+        PS C:\> Set-ExecutionPolicy AllSigned
+
+    Then you'll be asked to trust the signer, when executing the script.
+    You will be prompted with the following::
+
+        PS C:\> virtualenv .\foo
+        New python executable in C:\foo\Scripts\python.exe
+        Installing setuptools................done.
+        Installing pip...................done.
+        PS C:\> .\foo\scripts\activate
+
+        Do you want to run software from this untrusted publisher?
+        File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info,
+        CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0
+        and is not trusted on your system. Only run scripts from trusted publishers.
+        [V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help
+        (default is "D"):A
+        (foo) PS C:\>
+
+    If you select ``[A] Always Run``, the certificate will be added to the
+    Trusted Publishers of your user account, and will be trusted in this
+    user's context henceforth. If you select ``[R] Run Once``, the script will
+    be run, but you will be prometed on a subsequent invocation. Advanced users
+    can add the signer's certificate to the Trusted Publishers of the Computer
+    account to apply to all users (though this technique is out of scope of this
+    document).
+
+    Alternatively, you may relax the system execution policy to allow running
+    of local scripts without verifying the code signature using the following::
+
+        PS C:\> Set-ExecutionPolicy RemoteSigned
+
+    Since the ``activate.ps1`` script is generated locally for each virtualenv,
+    it is not considered a remote script and can then be executed.
+
+.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
+
+The ``--system-site-packages`` Option
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you build with ``virtualenv --system-site-packages ENV``, your virtual
+environment will inherit packages from ``/usr/lib/python2.7/site-packages``
+(or wherever your global site-packages directory is).
+
+This can be used if you have control over the global site-packages directory,
+and you want to depend on the packages there. If you want isolation from the
+global system, do not use this flag.
+
+
+Environment variables and configuration files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+virtualenv can not only be configured by passing command line options such as
+``--python`` but also by two other means:
+
+- Environment variables
+
+  Each command line option is automatically used to look for environment
+  variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
+  the name of the command line options are capitalized and have dashes
+  (``'-'``) replaced with underscores (``'_'``).
+
+  For example, to automatically use a custom Python binary instead of the
+  one virtualenv is run with you can also set an environment variable::
+
+      $ export VIRTUALENV_PYTHON=/opt/python-3.3/bin/python
+      $ virtualenv ENV
+
+  It's the same as passing the option to virtualenv directly::
+
+      $ virtualenv --python=/opt/python-3.3/bin/python ENV
+
+  This also works for appending command line options, like ``--find-links``.
+  Just leave an empty space between the passsed values, e.g.::
+
+      $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
+      $ virtualenv ENV
+
+  is the same as calling::
+
+      $ virtualenv --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
+
+- Config files
+
+  virtualenv also looks for a standard ini config file. On Unix and Mac OS X
+  that's ``$HOME/.virtualenv/virtualenv.ini`` and on Windows, it's
+  ``%APPDATA%\virtualenv\virtualenv.ini``.
+
+  The names of the settings are derived from the long command line option,
+  e.g. the option ``--python`` would look like this::
+
+      [virtualenv]
+      python = /opt/python-3.3/bin/python
+
+  Appending options like ``--extra-search-dir`` can be written on multiple
+  lines::
+
+      [virtualenv]
+      extra-search-dir =
+          /path/to/dists
+          /path/to/other/dists
+
+Please have a look at the output of ``virtualenv --help`` for a full list
+of supported options.
+
+Windows Notes
+~~~~~~~~~~~~~
+
+Some paths within the virtualenv are slightly different on Windows: scripts and
+executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
+libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
+
+To create a virtualenv under a path with spaces in it on Windows, you'll need
+the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
+
+PyPy Support
+~~~~~~~~~~~~
+
+Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
+supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
+To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
+
+Creating Your Own Bootstrap Scripts
+-----------------------------------
+
+While this creates an environment, it doesn't put anything into the
+environment. Developers may find it useful to distribute a script
+that sets up a particular environment, for example a script that
+installs a particular web application.
+
+To create a script like this, call
+``virtualenv.create_bootstrap_script(extra_text)``, and write the
+result to your new bootstrapping script. Here's the documentation
+from the docstring:
+
+Creates a bootstrap script, which is like this script but with
+extend_parser, adjust_options, and after_install hooks.
+
+This returns a string that (written to disk of course) can be used
+as a bootstrap script with your own customizations. The script
+will be the standard virtualenv.py script, with your extra text
+added (your extra text should be Python code).
+
+If you include these functions, they will be called:
+
+``extend_parser(optparse_parser)``:
+    You can add or remove options from the parser here.
+
+``adjust_options(options, args)``:
+    You can change options here, or change the args (if you accept
+    different kinds of arguments, be sure you modify ``args`` so it is
+    only ``[DEST_DIR]``).
+
+``after_install(options, home_dir)``:
+
+    After everything is installed, this function is called. This
+    is probably the function you are most likely to use. An
+    example would be::
+
+        def after_install(options, home_dir):
+            if sys.platform == 'win32':
+                bin = 'Scripts'
+            else:
+                bin = 'bin'
+            subprocess.call([join(home_dir, bin, 'easy_install'),
+                             'MyPackage'])
+            subprocess.call([join(home_dir, bin, 'my-package-script'),
+                             'setup', home_dir])
+
+    This example immediately installs a package, and runs a setup
+    script from that package.
+
+Bootstrap Example
+~~~~~~~~~~~~~~~~~
+
+Here's a more concrete example of how you could use this::
+
+    import virtualenv, textwrap
+    output = virtualenv.create_bootstrap_script(textwrap.dedent("""
+    import os, subprocess
+    def after_install(options, home_dir):
+        etc = join(home_dir, 'etc')
+        if not os.path.exists(etc):
+            os.makedirs(etc)
+        subprocess.call([join(home_dir, 'bin', 'easy_install'),
+                         'BlogApplication'])
+        subprocess.call([join(home_dir, 'bin', 'paster'),
+                         'make-config', 'BlogApplication',
+                         join(etc, 'blog.ini')])
+        subprocess.call([join(home_dir, 'bin', 'paster'),
+                         'setup-app', join(etc, 'blog.ini')])
+    """))
+    f = open('blog-bootstrap.py', 'w').write(output)
+
+Another example is available `here
+<https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py>`_.
+
+
+Using Virtualenv without ``bin/python``
+---------------------------------------
+
+Sometimes you can't or don't want to use the Python interpreter
+created by the virtualenv. For instance, in a `mod_python
+<http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
+environment, there is only one interpreter.
+
+Luckily, it's easy. You must use the custom Python interpreter to
+*install* libraries. But to *use* libraries, you just have to be sure
+the path is correct. A script is available to correct the path. You
+can setup the environment like::
+
+    activate_this = '/path/to/env/bin/activate_this.py'
+    execfile(activate_this, dict(__file__=activate_this))
+
+This will change ``sys.path`` and even change ``sys.prefix``, but also allow
+you to use an existing interpreter. Items in your environment will show up
+first on ``sys.path``, before global items. However, global items will
+always be accessible (as if the ``--system-site-packages`` flag had been used
+in creating the environment, whether it was or not). Also, this cannot undo
+the activation of other environments, or modules that have been imported.
+You shouldn't try to, for instance, activate an environment before a web
+request; you should activate *one* environment as early as possible, and not
+do it again in that process.
+
+Making Environments Relocatable
+-------------------------------
+
+Note: this option is somewhat experimental, and there are probably
+caveats that have not yet been identified.
+
+.. warning::
+
+    The ``--relocatable`` option currently has a number of issues,
+    and is not guaranteed to work in all circumstances. It is possible
+    that the option will be deprecated in a future version of ``virtualenv``.
+
+Normally environments are tied to a specific path. That means that
+you cannot move an environment around or copy it to another computer.
+You can fix up an environment to make it relocatable with the
+command::
+
+    $ virtualenv --relocatable ENV
+
+This will make some of the files created by setuptools use relative paths,
+and will change all the scripts to use ``activate_this.py`` instead of using
+the location of the Python interpreter to select the environment.
+
+**Note:** scripts which have been made relocatable will only work if
+the virtualenv is activated, specifically the python executable from
+the virtualenv must be the first one on the system PATH. Also note that
+the activate scripts are not currently made relocatable by
+``virtualenv --relocatable``.
+
+**Note:** you must run this after you've installed *any* packages into
+the environment. If you make an environment relocatable, then
+install a new package, you must run ``virtualenv --relocatable``
+again.
+
+Also, this **does not make your packages cross-platform**. You can
+move the directory around, but it can only be used on other similar
+computers. Some known environmental differences that can cause
+incompatibilities: a different version of Python, when one platform
+uses UCS2 for its internal unicode representation and another uses
+UCS4 (a compile-time option), obvious platform changes like Windows
+vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
+libraries on the system, if those C libraries are located somewhere
+different (either different versions, or a different filesystem
+layout).
+
+If you use this flag to create an environment, currently, the
+``--system-site-packages`` option will be implied.
+
+The ``--extra-search-dir`` option
+---------------------------------
+
+.. note::
+
+    Currently, this feature only partially works for pip, and not at
+    all for setuptools. For details,
+    see `Issue #327 <https://github.com/pypa/virtualenv/issues/327>`_
+
+This option allows you to provide your own versions of setuptools
+and/or pip on the filesystem, and tell virtualenv to use those distributions
+instead of the ones in ``virtualenv_support``.
+
+To use this feature, pass one or more ``--extra-search-dir`` options to
+virtualenv like this::
+
+    $ virtualenv --extra-search-dir=/path/to/distributions ENV
+
+The ``/path/to/distributions`` path should point to a directory that
+contains setuptools and/or pip distributions. Setuptools distributions
+must be ``.egg`` files; pip distributions should be `.tar.gz` source
+distributions.
+
+If no satisfactory local distributions are found, virtualenv will fail. Virtualenv will never download packages.
+
+The distribution lookup is done in the following locations, with the most
+recent version found used:
+
+#. The current directory.
+#. The directory where virtualenv.py is located.
+#. A ``virtualenv_support`` directory relative to the directory where
+   virtualenv.py is located.
+#. If the file being executed is not named virtualenv.py (i.e. is a boot
+   script), a ``virtualenv_support`` directory relative to wherever
+   virtualenv.py is actually installed.
+
+
+Compare & Contrast with Alternatives
+------------------------------------
+
+There are several alternatives that create isolated environments:
+
+* ``workingenv`` (which I do not suggest you use anymore) is the
+  predecessor to this library. It used the main Python interpreter,
+  but relied on setting ``$PYTHONPATH`` to activate the environment.
+  This causes problems when running Python scripts that aren't part of
+  the environment (e.g., a globally installed ``hg`` or ``bzr``). It
+  also conflicted a lot with Setuptools.
+
+* `virtual-python
+  <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
+  is also a predecessor to this library. It uses only symlinks, so it
+  couldn't work on Windows. It also symlinks over the *entire*
+  standard library and global ``site-packages``. As a result, it
+  won't see new additions to the global ``site-packages``.
+
+  This script only symlinks a small portion of the standard library
+  into the environment, and so on Windows it is feasible to simply
+  copy these files over. Also, it creates a new/empty
+  ``site-packages`` and also adds the global ``site-packages`` to the
+  path, so updates are tracked separately. This script also installs
+  Setuptools automatically, saving a step and avoiding the need for
+  network access.
+
+* `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
+  create an isolated Python environment in the same style, but
+  achieves similar results through a declarative config file that sets
+  up scripts with very particular packages. As a declarative system,
+  it is somewhat easier to repeat and manage, but more difficult to
+  experiment with. ``zc.buildout`` includes the ability to setup
+  non-Python systems (e.g., a database server or an Apache instance).
+
+I *strongly* recommend anyone doing application development or
+deployment use one of these tools.
+
+Contributing
+------------
+
+Refer to the `contributing to pip`_ documentation - it applies equally to
+virtualenv, except that virtualenv issues should filed on the `virtualenv
+repo`_ at GitHub.
+
+Virtualenv's release schedule is tied to pip's -- each time there's a new pip
+release, there will be a new virtualenv release that bundles the new version of
+pip.
+
+Files in the `virtualenv_embedded/` subdirectory are embedded into
+`virtualenv.py` itself as base64-encoded strings (in order to support
+single-file use of `virtualenv.py` without installing it). If your patch
+changes any file in `virtualenv_embedded/`, run `bin/rebuild-script.py` to
+update the embedded version of that file in `virtualenv.py`; commit that and
+submit it as part of your patch / pull request.
+
+.. _contributing to pip: http://www.pip-installer.org/en/latest/contributing.html
+.. _virtualenv repo: https://github.com/pypa/virtualenv/
+
+Running the tests
+~~~~~~~~~~~~~~~~~
+
+Virtualenv's test suite is small and not yet at all comprehensive, but we aim
+to grow it.
+
+The easy way to run tests (handles test dependencies automatically)::
+
+    $ python setup.py test
+
+If you want to run only a selection of the tests, you'll need to run them
+directly with nose instead. Create a virtualenv, and install required
+packages::
+
+    $ pip install nose mock
+
+Run nosetests::
+
+    $ nosetests
+
+Or select just a single test file to run::
+
+    $ nosetests tests.test_virtualenv
+
+
+Other Documentation and Links
+-----------------------------
+
+* James Gardner has written a tutorial on using `virtualenv with
+  Pylons
+  <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
+
+* `Blog announcement
+  <http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
+
+* Doug Hellmann wrote a description of his `command-line work flow
+  using virtualenv (virtualenvwrapper)
+  <http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
+  including some handy scripts to make working with multiple
+  environments easier. He also wrote `an example of using virtualenv
+  to try IPython
+  <http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
+
+* Chris Perkins created a `showmedo video including virtualenv
+  <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
+
+* `Using virtualenv with mod_wsgi
+  <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
+
+* `virtualenv commands
+  <https://github.com/thisismedium/virtualenv-commands>`_ for some more
+  workflow-related tools around virtualenv.
+
+Status and License
+------------------
+
+``virtualenv`` is a successor to `workingenv
+<http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
+of `virtual-python
+<http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
+
+It was written by Ian Bicking, sponsored by the `Open Planning
+Project <http://openplans.org>`_ and is now maintained by a
+`group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
+It is licensed under an
+`MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
deleted file mode 100644
--- a/python/virtualenv/docs/index.txt
+++ /dev/null
@@ -1,573 +0,0 @@
-virtualenv
-==========
-
-* `Discussion list <http://groups.google.com/group/python-virtualenv/>`_
-* `Bugs <https://github.com/pypa/virtualenv/issues/>`_
-
-.. contents::
-
-.. toctree::
-   :maxdepth: 1
-
-   news
-
-.. comment: split here
-
-Installation
-------------
-
-You can install virtualenv with ``pip install virtualenv``, or the `latest
-development version <https://github.com/pypa/virtualenv/tarball/develop>`_
-with ``pip install https://github.com/pypa/virtualenv/tarball/develop``.
-
-You can also use ``easy_install``, or if you have no Python package manager
-available at all, you can just grab the single file `virtualenv.py`_ and run
-it with ``python virtualenv.py``.
-
-.. _virtualenv.py: https://raw.github.com/pypa/virtualenv/master/virtualenv.py
-
-What It Does
-------------
-
-``virtualenv`` is a tool to create isolated Python environments.
-
-The basic problem being addressed is one of dependencies and versions,
-and indirectly permissions.  Imagine you have an application that
-needs version 1 of LibFoo, but another application requires version
-2.  How can you use both these applications?  If you install
-everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
-platform's standard location is), it's easy to end up in a situation
-where you unintentionally upgrade an application that shouldn't be
-upgraded.
-
-Or more generally, what if you want to install an application *and
-leave it be*?  If an application works, any change in its libraries or
-the versions of those libraries can break the application.
-
-Also, what if you can't install packages into the global
-``site-packages`` directory?  For instance, on a shared host.
-
-In all these cases, ``virtualenv`` can help you.  It creates an
-environment that has its own installation directories, that doesn't
-share libraries with other virtualenv environments (and optionally
-doesn't access the globally installed libraries either).
-
-Usage
------
-
-The basic usage is::
-
-    $ python virtualenv.py ENV
-
-If you install it you can also just do ``virtualenv ENV``.
-
-This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
-install will go.  It also creates ``ENV/bin/python``, which is a Python
-interpreter that uses this environment.  Anytime you use that interpreter
-(including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
-in that environment will be used.
-
-It also installs either `Setuptools
-<http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
-<http://pypi.python.org/pypi/distribute>`_ into the environment. To use
-Distribute instead of setuptools, just call virtualenv like this::
-
-    $ python virtualenv.py --distribute ENV
-
-You can also set the environment variable VIRTUALENV_DISTRIBUTE.
-
-A new virtualenv also includes the `pip <http://pypi.python.org/pypi/pip>`_
-installer, so you can use ``ENV/bin/pip`` to install additional packages into
-the environment.
-
-
-activate script
-~~~~~~~~~~~~~~~
-
-In a newly created virtualenv there will be a ``bin/activate`` shell
-script. For Windows systems, activation scripts are provided for CMD.exe
-and Powershell.
-
-On Posix systems you can do::
-
-    $ source bin/activate
-
-This will change your ``$PATH`` so its first entry is the virtualenv's
-``bin/`` directory.  (You have to use ``source`` because it changes your
-shell environment in-place.) This is all it does; it's purely a
-convenience.  If you directly run a script or the python interpreter
-from the virtualenv's ``bin/`` directory (e.g.  ``path/to/env/bin/pip``
-or ``/path/to/env/bin/python script.py``) there's no need for
-activation.
-
-After activating an environment you can use the function ``deactivate`` to
-undo the changes to your ``$PATH``.
-
-The ``activate`` script will also modify your shell prompt to indicate
-which environment is currently active.  You can disable this behavior,
-which can be useful if you have your own custom prompt that already
-displays the active environment name.  To do so, set the
-``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
-value before running the ``activate`` script.
-
-On Windows you just do::
-
-    > \path\to\env\Scripts\activate
-
-And type `deactivate` to undo the changes.
-
-Based on your active shell (CMD.exe or Powershell.exe), Windows will use
-either activate.bat or activate.ps1 (as appropriate) to activate the
-virtual environment. If using Powershell, see the notes about code signing
-below.
-
-.. note::
-
-    If using Powershell, the ``activate`` script is subject to the
-    `execution policies`_ on the system. By default on Windows 7, the system's
-    excution policy is set to ``Restricted``, meaning no scripts like the
-    ``activate`` script are allowed to be executed. But that can't stop us
-    from changing that slightly to allow it to be executed.
-
-    In order to use the script, you have to relax your system's execution
-    policy to ``AllSigned``, meaning all scripts on the system must be
-    digitally signed to be executed. Since the virtualenv activation
-    script is signed by one of the authors (Jannis Leidel) this level of
-    the execution policy suffices. As an administrator run::
-
-        PS C:\> Set-ExecutionPolicy AllSigned
-
-    Then you'll be asked to trust the signer, when executing the script.
-    You will be prompted with the following::
-
-        PS C:\> virtualenv .\foo
-        New python executable in C:\foo\Scripts\python.exe
-        Installing setuptools................done.
-        Installing pip...................done.
-        PS C:\> .\foo\scripts\activate
-
-        Do you want to run software from this untrusted publisher?
-        File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info,
-        CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0
-        and is not trusted on your system. Only run scripts from trusted publishers.
-        [V] Never run  [D] Do not run  [R] Run once  [A] Always run  [?] Help
-        (default is "D"):A
-        (foo) PS C:\>
-
-    If you select ``[A] Always Run``, the certificate will be added to the
-    Trusted Publishers of your user account, and will be trusted in this
-    user's context henceforth. If you select ``[R] Run Once``, the script will
-    be run, but you will be prometed on a subsequent invocation. Advanced users
-    can add the signer's certificate to the Trusted Publishers of the Computer
-    account to apply to all users (though this technique is out of scope of this
-    document).
-
-    Alternatively, you may relax the system execution policy to allow running
-    of local scripts without verifying the code signature using the following::
-
-        PS C:\> Set-ExecutionPolicy RemoteSigned
-
-    Since the ``activate.ps1`` script is generated locally for each virtualenv,
-    it is not considered a remote script and can then be executed.
-
-.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
-
-The ``--system-site-packages`` Option
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you build with ``virtualenv --system-site-packages ENV``, your virtual
-environment will inherit packages from ``/usr/lib/python2.7/site-packages``
-(or wherever your global site-packages directory is).
-
-This can be used if you have control over the global site-packages directory,
-and you want to depend on the packages there.  If you want isolation from the
-global system, do not use this flag.
-
-
-Environment variables and configuration files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-virtualenv can not only be configured by passing command line options such as
-``--distribute`` but also by two other means:
-
-- Environment variables
-
-  Each command line option is automatically used to look for environment
-  variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
-  the name of the command line options are capitalized and have dashes
-  (``'-'``) replaced with underscores (``'_'``).
-
-  For example, to automatically install Distribute instead of setuptools
-  you can also set an environment variable::
-
-      $ export VIRTUALENV_DISTRIBUTE=true
-      $ python virtualenv.py ENV
-
-  It's the same as passing the option to virtualenv directly::
-
-      $ python virtualenv.py --distribute ENV
-
-  This also works for appending command line options, like ``--find-links``.
-  Just leave an empty space between the passsed values, e.g.::
-
-      $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
-      $ virtualenv ENV
-
-  is the same as calling::
-
-      $ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
-
-- Config files
-
-  virtualenv also looks for a standard ini config file. On Unix and Mac OS X
-  that's ``$HOME/.virtualenv/virtualenv.ini`` and on Windows, it's
-  ``%APPDATA%\virtualenv\virtualenv.ini``.
-
-  The names of the settings are derived from the long command line option,
-  e.g. the option ``--distribute`` would look like this::
-
-      [virtualenv]
-      distribute = true
-
-  Appending options like ``--extra-search-dir`` can be written on multiple
-  lines::
-
-      [virtualenv]
-      extra-search-dir =
-          /path/to/dists
-          /path/to/other/dists
-
-Please have a look at the output of ``virtualenv --help`` for a full list
-of supported options.
-
-Windows Notes
-~~~~~~~~~~~~~
-
-Some paths within the virtualenv are slightly different on Windows: scripts and
-executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
-libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
-
-To create a virtualenv under a path with spaces in it on Windows, you'll need
-the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
-
-PyPy Support
-~~~~~~~~~~~~
-
-Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
-supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
-To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
-
-Creating Your Own Bootstrap Scripts
------------------------------------
-
-While this creates an environment, it doesn't put anything into the
-environment.  Developers may find it useful to distribute a script
-that sets up a particular environment, for example a script that
-installs a particular web application.
-
-To create a script like this, call
-``virtualenv.create_bootstrap_script(extra_text)``, and write the
-result to your new bootstrapping script.  Here's the documentation
-from the docstring:
-
-Creates a bootstrap script, which is like this script but with
-extend_parser, adjust_options, and after_install hooks.
-
-This returns a string that (written to disk of course) can be used
-as a bootstrap script with your own customizations.  The script
-will be the standard virtualenv.py script, with your extra text
-added (your extra text should be Python code).
-
-If you include these functions, they will be called:
-
-``extend_parser(optparse_parser)``:
-    You can add or remove options from the parser here.
-
-``adjust_options(options, args)``:
-    You can change options here, or change the args (if you accept
-    different kinds of arguments, be sure you modify ``args`` so it is
-    only ``[DEST_DIR]``).
-
-``after_install(options, home_dir)``:
-
-    After everything is installed, this function is called.  This
-    is probably the function you are most likely to use.  An
-    example would be::
-
-        def after_install(options, home_dir):
-            if sys.platform == 'win32':
-                bin = 'Scripts'
-            else:
-                bin = 'bin'
-            subprocess.call([join(home_dir, bin, 'easy_install'),
-                             'MyPackage'])
-            subprocess.call([join(home_dir, bin, 'my-package-script'),
-                             'setup', home_dir])
-
-    This example immediately installs a package, and runs a setup
-    script from that package.
-
-Bootstrap Example
-~~~~~~~~~~~~~~~~~
-
-Here's a more concrete example of how you could use this::
-
-    import virtualenv, textwrap
-    output = virtualenv.create_bootstrap_script(textwrap.dedent("""
-    import os, subprocess
-    def after_install(options, home_dir):
-        etc = join(home_dir, 'etc')
-        if not os.path.exists(etc):
-            os.makedirs(etc)
-        subprocess.call([join(home_dir, 'bin', 'easy_install'),
-                         'BlogApplication'])
-        subprocess.call([join(home_dir, 'bin', 'paster'),
-                         'make-config', 'BlogApplication',
-                         join(etc, 'blog.ini')])
-        subprocess.call([join(home_dir, 'bin', 'paster'),
-                         'setup-app', join(etc, 'blog.ini')])
-    """))
-    f = open('blog-bootstrap.py', 'w').write(output)
-
-Another example is available `here
-<https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py>`_.
-
-
-Using Virtualenv without ``bin/python``
----------------------------------------
-
-Sometimes you can't or don't want to use the Python interpreter
-created by the virtualenv.  For instance, in a `mod_python
-<http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
-environment, there is only one interpreter.
-
-Luckily, it's easy.  You must use the custom Python interpreter to
-*install* libraries.  But to *use* libraries, you just have to be sure
-the path is correct.  A script is available to correct the path.  You
-can setup the environment like::
-
-    activate_this = '/path/to/env/bin/activate_this.py'
-    execfile(activate_this, dict(__file__=activate_this))
-
-This will change ``sys.path`` and even change ``sys.prefix``, but also allow
-you to use an existing interpreter.  Items in your environment will show up
-first on ``sys.path``, before global items.  However, global items will
-always be accessible (as if the ``--system-site-packages`` flag had been used
-in creating the environment, whether it was or not).  Also, this cannot undo
-the activation of other environments, or modules that have been imported.
-You shouldn't try to, for instance, activate an environment before a web
-request; you should activate *one* environment as early as possible, and not
-do it again in that process.
-
-Making Environments Relocatable
--------------------------------
-
-Note: this option is somewhat experimental, and there are probably
-caveats that have not yet been identified.  Also this does not
-currently work on Windows.
-
-Normally environments are tied to a specific path.  That means that
-you cannot move an environment around or copy it to another computer.
-You can fix up an environment to make it relocatable with the
-command::
-
-    $ virtualenv --relocatable ENV
-
-This will make some of the files created by setuptools or distribute
-use relative paths, and will change all the scripts to use ``activate_this.py``
-instead of using the location of the Python interpreter to select the
-environment.
-
-**Note:** you must run this after you've installed *any* packages into
-the environment.  If you make an environment relocatable, then
-install a new package, you must run ``virtualenv --relocatable``
-again.
-
-Also, this **does not make your packages cross-platform**.  You can
-move the directory around, but it can only be used on other similar
-computers.  Some known environmental differences that can cause
-incompatibilities: a different version of Python, when one platform
-uses UCS2 for its internal unicode representation and another uses
-UCS4 (a compile-time option), obvious platform changes like Windows
-vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
-libraries on the system, if those C libraries are located somewhere
-different (either different versions, or a different filesystem
-layout).
-
-If you use this flag to create an environment, currently, the
-``--system-site-packages`` option will be implied.
-
-The ``--extra-search-dir`` option
----------------------------------
-
-When it creates a new environment, virtualenv installs either setuptools
-or distribute, and pip.  In normal operation when virtualenv is
-installed, the bundled version of these packages included in the
-``virtualenv_support`` directory is used. When ``virtualenv.py`` is run
-standalone and ``virtualenv_support`` is not available, the latest
-releases of these packages are fetched from the `Python Package Index
-<http://pypi.python.org>`_ (PyPI).
-
-As an alternative, you can provide your own versions of setuptools,
-distribute and/or pip on the filesystem, and tell virtualenv to use
-those distributions instead of downloading them from the Internet.  To
-use this feature, pass one or more ``--extra-search-dir`` options to
-virtualenv like this::
-
-    $ virtualenv --extra-search-dir=/path/to/distributions ENV
-
-The ``/path/to/distributions`` path should point to a directory that
-contains setuptools, distribute and/or pip distributions.  Setuptools
-distributions must be ``.egg`` files; pip distributions should be
-`.tar.gz` source distributions, and distribute distributions may be
-either (if found an egg will be used preferentially).
-
-Virtualenv will still download these packages if no satisfactory local
-distributions are found.
-
-If you are really concerned about virtualenv fetching these packages
-from the Internet and want to ensure that it never will, you can also
-provide an option ``--never-download`` like so::
-
-    $ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV
-
-If this option is provided, virtualenv will never try to download
-setuptools/distribute or pip. Instead, it will exit with status code 1
-if it fails to find local distributions for any of these required
-packages. The local distribution lookup is done in the following
-locations, with the most recent version found used:
-
-    #. The current directory.
-    #. The directory where virtualenv.py is located.
-    #. A ``virtualenv_support`` directory relative to the directory where
-       virtualenv.py is located.
-    #. If the file being executed is not named virtualenv.py (i.e. is a boot
-       script), a ``virtualenv_support`` directory relative to wherever
-       virtualenv.py is actually installed.
-
-
-Compare & Contrast with Alternatives
-------------------------------------
-
-There are several alternatives that create isolated environments:
-
-* ``workingenv`` (which I do not suggest you use anymore) is the
-  predecessor to this library.  It used the main Python interpreter,
-  but relied on setting ``$PYTHONPATH`` to activate the environment.
-  This causes problems when running Python scripts that aren't part of
-  the environment (e.g., a globally installed ``hg`` or ``bzr``).  It
-  also conflicted a lot with Setuptools.
-
-* `virtual-python
-  <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
-  is also a predecessor to this library.  It uses only symlinks, so it
-  couldn't work on Windows.  It also symlinks over the *entire*
-  standard library and global ``site-packages``.  As a result, it
-  won't see new additions to the global ``site-packages``.
-
-  This script only symlinks a small portion of the standard library
-  into the environment, and so on Windows it is feasible to simply
-  copy these files over.  Also, it creates a new/empty
-  ``site-packages`` and also adds the global ``site-packages`` to the
-  path, so updates are tracked separately.  This script also installs
-  Setuptools automatically, saving a step and avoiding the need for
-  network access.
-
-* `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
-  create an isolated Python environment in the same style, but
-  achieves similar results through a declarative config file that sets
-  up scripts with very particular packages.  As a declarative system,
-  it is somewhat easier to repeat and manage, but more difficult to
-  experiment with.  ``zc.buildout`` includes the ability to setup
-  non-Python systems (e.g., a database server or an Apache instance).
-
-I *strongly* recommend anyone doing application development or
-deployment use one of these tools.
-
-Contributing
-------------
-
-Refer to the `contributing to pip`_ documentation - it applies equally to
-virtualenv, except that virtualenv issues should filed on the `virtualenv
-repo`_ at GitHub.
-
-Virtualenv's release schedule is tied to pip's -- each time there's a new pip
-release, there will be a new virtualenv release that bundles the new version of
-pip.
-
-Files in the `virtualenv_embedded/` subdirectory are embedded into
-`virtualenv.py` itself as base64-encoded strings (in order to support
-single-file use of `virtualenv.py` without installing it). If your patch
-changes any file in `virtualenv_embedded/`, run `bin/rebuild-script.py` to
-update the embedded version of that file in `virtualenv.py`; commit that and
-submit it as part of your patch / pull request.
-
-.. _contributing to pip: http://www.pip-installer.org/en/latest/contributing.html
-.. _virtualenv repo: https://github.com/pypa/virtualenv/
-
-Running the tests
-~~~~~~~~~~~~~~~~~
-
-Virtualenv's test suite is small and not yet at all comprehensive, but we aim
-to grow it.
-
-The easy way to run tests (handles test dependencies automatically)::
-
-    $ python setup.py test
-
-If you want to run only a selection of the tests, you'll need to run them
-directly with nose instead. Create a virtualenv, and install required
-packages::
-
-    $ pip install nose mock
-
-Run nosetests::
-
-    $ nosetests
-
-Or select just a single test file to run::
-
-    $ nosetests tests.test_virtualenv
-
-
-Other Documentation and Links
------------------------------
-
-* James Gardner has written a tutorial on using `virtualenv with
-  Pylons
-  <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
-
-* `Blog announcement
-  <http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
-
-* Doug Hellmann wrote a description of his `command-line work flow
-  using virtualenv (virtualenvwrapper)
-  <http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
-  including some handy scripts to make working with multiple
-  environments easier.  He also wrote `an example of using virtualenv
-  to try IPython
-  <http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
-
-* Chris Perkins created a `showmedo video including virtualenv
-  <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
-
-* `Using virtualenv with mod_wsgi
-  <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
-
-* `virtualenv commands
-  <https://github.com/thisismedium/virtualenv-commands>`_ for some more
-  workflow-related tools around virtualenv.
-
-Status and License
-------------------
-
-``virtualenv`` is a successor to `workingenv
-<http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
-of `virtual-python
-<http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
-
-It was written by Ian Bicking, sponsored by the `Open Planning
-Project <http://openplans.org>`_ and is now maintained by a
-`group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
-It is licensed under an
-`MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
new file mode 100644
--- /dev/null
+++ b/python/virtualenv/docs/news.rst
@@ -0,0 +1,691 @@
+Changes & News
+--------------
+
+.. warning::
+
+   Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that
+   will cause "import random" to fail with "cannot import name urandom" on any
+   virtualenv created on a Unix host with an earlier release of Python
+   2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to
+   the fact that a virtualenv uses the system Python's standard library but
+   contains its own copy of the Python interpreter, so an upgrade to the system
+   Python results in a mismatch between the version of the Python interpreter
+   and the version of the standard library. It can be fixed by removing
+   ``$ENV/bin/python`` and re-running virtualenv on the same target directory
+   with the upgraded Python.
+
+1.10.1 (2013-08-07)
+~~~~~~~~~~~~~~~~~~~
+
+* **New Signing Key** Release 1.10.1 is using a different key than normal with
+  fingerprint: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
+* Upgraded pip to v1.4.1
+* Upgraded setuptools to v0.9.8
+
+
+1.10 (2013-07-23)
+~~~~~~~~~~~~~~~~~
+
+* **BACKWARDS INCOMPATIBLE** Dropped support for Python 2.5. The minimum
+  supported Python version is now Python 2.6.
+
+* **BACKWARDS INCOMPATIBLE** Using ``virtualenv.py`` as an isolated script
+  (i.e. without an associated ``virtualenv_support`` directory) is no longer
+  supported for security reasons and will fail with an error.
+
+  Along with this, ``--never-download`` is now always pinned to ``True``, and
+  is only being maintained in the short term for backward compatibility
+  (Pull #412).
+
+* **IMPORTANT** Switched to the new setuptools (v0.9.7) which has been merged
+  with Distribute_ again and works for Python 2 and 3 with one codebase.
+  The ``--distribute`` and ``--setuptools`` options are now no-op.
+
+* Updated to pip 1.4.
+
+* Added support for PyPy3k
+
+* Added the option to use a version number with the ``-p`` option to get the
+  system copy of that Python version (Windows only)
+
+* Removed embedded ``ez_setup.py``, ``distribute_setup.py`` and
+  ``distribute_from_egg.py`` files as part of switching to merged setuptools.
+
+* Fixed ``--relocatable`` to work better on Windows.
+
+* Fixed issue with readline on Windows.
+
+.. _Distribute: https://pypi.python.org/pypi/distribute
+
+1.9.1 (2013-03-08)
+~~~~~~~~~~~~~~~~~~
+
+* Updated to pip 1.3.1 that fixed a major backward incompatible change of
+  parsing URLs to externally hosted packages that got accidentily included
+  in pip 1.3.
+
+1.9 (2013-03-07)
+~~~~~~~~~~~~~~~~
+
+* Unset VIRTUAL_ENV environment variable in deactivate.bat (Pull #364)
+* Upgraded distribute to 0.6.34.
+* Added ``--no-setuptools`` and ``--no-pip`` options (Pull #336).
+* Fixed Issue #373. virtualenv-1.8.4 was failing in cygwin (Pull #382).
+* Fixed Issue #378. virtualenv is now "multiarch" aware on debian/ubuntu (Pull #379).
+* Fixed issue with readline module path on pypy and OSX (Pull #374).
+* Made 64bit detection compatible with Python 2.5 (Pull #393).
+
+
+1.8.4 (2012-11-25)
+~~~~~~~~~~~~~~~~~~
+
+* Updated distribute to 0.6.31. This fixes #359 (numpy install regression) on
+  UTF-8 platforms, and provides a workaround on other platforms:
+  ``PYTHONIOENCODING=utf8 pip install numpy``.
+
+* When installing virtualenv via curl, don't forget to filter out arguments
+  the distribute setup script won't understand. Fixes #358.
+
+* Added some more integration tests.
+
+* Removed the unsupported embedded setuptools egg for Python 2.4 to reduce
+  file size.
+
+1.8.3 (2012-11-21)
+~~~~~~~~~~~~~~~~~~
+
+* Fixed readline on OS X. Thanks minrk
+
+* Updated distribute to 0.6.30 (improves our error reporting, plus new
+  distribute features and fixes). Thanks Gabriel (g2p)
+
+* Added compatibility with multiarch Python (Python 3.3 for example). Added an
+  integration test. Thanks Gabriel (g2p)
+
+* Added ability to install distribute from a user-provided egg, rather than the
+  bundled sdist, for better speed. Thanks Paul Moore.
+
+* Make the creation of lib64 symlink smarter about already-existing symlink,
+  and more explicit about full paths. Fixes #334 and #330. Thanks Jeremy Orem.
+
+* Give lib64 site-dir preference over lib on 64-bit systems, to avoid wrong
+  32-bit compiles in the venv. Fixes #328. Thanks Damien Nozay.
+
+* Fix a bug with prompt-handling in ``activate.csh`` in non-interactive csh
+  shells. Fixes #332. Thanks Benjamin Root for report and patch.
+
+* Make it possible to create a virtualenv from within a Python
+  3.3. pyvenv. Thanks Chris McDonough for the report.
+
+* Add optional --setuptools option to be able to switch to it in case
+  distribute is the default (like in Debian).
+
+1.8.2 (2012-09-06)
+~~~~~~~~~~~~~~~~~~
+
+* Updated the included pip version to 1.2.1 to fix regressions introduced
+  there in 1.2.
+
+
+1.8.1 (2012-09-03)
+~~~~~~~~~~~~~~~~~~
+
+* Fixed distribute version used with `--never-download`. Thanks michr for
+  report and patch.
+
+* Fix creating Python 3.3 based virtualenvs by unsetting the
+  ``__PYVENV_LAUNCHER__`` environment variable in subprocesses.
+
+
+1.8 (2012-09-01)
+~~~~~~~~~~~~~~~~
+
+* **Dropped support for Python 2.4** The minimum supported Python version is
+  now Python 2.5.
+
+* Fix `--relocatable` on systems that use lib64. Fixes #78. Thanks Branden
+  Rolston.
+
+* Symlink some additional modules under Python 3. Fixes #194. Thanks Vinay
+  Sajip, Ian Clelland, and Stefan Holek for the report.
+
+* Fix ``--relocatable`` when a script uses ``__future__`` imports. Thanks
+  Branden Rolston.
+
+* Fix a bug in the config option parser that prevented setting negative
+  options with environemnt variables. Thanks Ralf Schmitt.
+
+* Allow setting ``--no-site-packages`` from the config file.
+
+* Use ``/usr/bin/multiarch-platform`` if available to figure out the include
+  directory. Thanks for the patch, Mika Laitio.
+
+* Fix ``install_name_tool`` replacement to work on Python 3.X.
+
+* Handle paths of users' site-packages on Mac OS X correctly when changing
+  the prefix.
+
+* Updated the embedded version of distribute to 0.6.28 and pip to 1.2.
+
+
+1.7.2 (2012-06-22)
+~~~~~~~~~~~~~~~~~~
+
+* Updated to distribute 0.6.27.
+
+* Fix activate.fish on OS X. Fixes #8. Thanks David Schoonover.
+
+* Create a virtualenv-x.x script with the Python version when installing, so
+  virtualenv for multiple Python versions can be installed to the same
+  script location. Thanks Miki Tebeka.
+
+* Restored ability to create a virtualenv with a path longer than 78
+  characters, without breaking creation of virtualenvs with non-ASCII paths.
+  Thanks, Bradley Ayers.
+
+* Added ability to create virtualenvs without having installed Apple's
+  developers tools (using an own implementation of ``install_name_tool``).
+  Thanks Mike Hommey.
+
+* Fixed PyPy and Jython support on Windows. Thanks Konstantin Zemlyak.
+
+* Added pydoc script to ease use. Thanks Marc Abramowitz. Fixes #149.
+
+* Fixed creating a bootstrap script on Python 3. Thanks Raul Leal. Fixes #280.
+
+* Fixed inconsistency when having set the ``PYTHONDONTWRITEBYTECODE`` env var
+  with the --distribute option or the ``VIRTUALENV_USE_DISTRIBUTE`` env var.
+  ``VIRTUALENV_USE_DISTRIBUTE`` is now considered again as a legacy alias.
+
+
+1.7.1.2 (2012-02-17)
+~~~~~~~~~~~~~~~~~~~~
+
+* Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat.
+
+
+1.7.1.1 (2012-02-16)
+~~~~~~~~~~~~~~~~~~~~
+
+* Bumped the version string in ``virtualenv.py`` up, too.
+
+* Fixed rST rendering bug of long description.
+
+
+1.7.1 (2012-02-16)
+~~~~~~~~~~~~~~~~~~
+
+* Update embedded pip to version 1.1.
+
+* Fix `--relocatable` under Python 3. Thanks Doug Hellmann.
+
+* Added environ PATH modification to activate_this.py. Thanks Doug
+  Napoleone. Fixes #14.
+
+* Support creating virtualenvs directly from a Python build directory on
+  Windows. Thanks CBWhiz. Fixes #139.
+
+* Use non-recursive symlinks to fix things up for posix_local install
+  scheme. Thanks michr.
+
+* Made activate script available for use with msys and cygwin on Windows.
+  Thanks Greg Haskins, Cliff Xuan, Jonathan Griffin and Doug Napoleone.
+  Fixes #176.
+
+* Fixed creation of virtualenvs on Windows when Python is not installed for
+  all users. Thanks Anatoly Techtonik for report and patch and Doug
+  Napoleone for testing and confirmation. Fixes #87.
+
+* Fixed creation of virtualenvs using -p in installs where some modules
+  that ought to be in the standard library (e.g. `readline`) are actually
+  installed in `site-packages` next to `virtualenv.py`. Thanks Greg Haskins
+  for report and fix. Fixes #167.
+
+* Added activation script for Powershell (signed by Jannis Leidel). Many
+  thanks to Jason R. Coombs.
+
+
+1.7 (2011-11-30)
+~~~~~~~~~~~~~~~~
+
+* Gave user-provided ``--extra-search-dir`` priority over default dirs for
+  finding setuptools/distribute (it already had priority for finding pip).
+  Thanks Ethan Jucovy.
+
+* Updated embedded Distribute release to 0.6.24. Thanks Alex Gronholm.
+
+* Made ``--no-site-packages`` behavior the default behavior.  The
+  ``--no-site-packages`` flag is still permitted, but displays a warning when
+  used. Thanks Chris McDonough.
+
+* New flag: ``--system-site-packages``; this flag should be passed to get the
+  previous default global-site-package-including behavior back.
+
+* Added ability to set command options as environment variables and options
+  in a ``virtualenv.ini`` file.
+
+* Fixed various encoding related issues with paths. Thanks Gunnlaugur Thor Briem.
+
+* Made ``virtualenv.py`` script executable.
+
+
+1.6.4 (2011-07-21)
+~~~~~~~~~~~~~~~~~~
+
+* Restored ability to run on Python 2.4, too.
+
+
+1.6.3 (2011-07-16)
+~~~~~~~~~~~~~~~~~~
+
+* Restored ability to run on Python < 2.7.
+
+
+1.6.2 (2011-07-16)
+~~~~~~~~~~~~~~~~~~
+
+* Updated embedded distribute release to 0.6.19.
+
+* Updated embedded pip release to 1.0.2.
+
+* Fixed #141 - Be smarter about finding pkg_resources when using the
+  non-default Python intepreter (by using the ``-p`` option).
+
+* Fixed #112 - Fixed path in docs.
+
+* Fixed #109 - Corrected doctests of a Logger method.
+
+* Fixed #118 - Fixed creating virtualenvs on platforms that use the
+  "posix_local" install scheme, such as Ubuntu with Python 2.7.
+
+* Add missing library to Python 3 virtualenvs (``_dummy_thread``).
+
+
+1.6.1 (2011-04-30)
+~~~~~~~~~~~~~~~~~~
+
+* Start to use git-flow.
+
+* Added support for PyPy 1.5
+
+* Fixed #121 -- added sanity-checking of the -p argument. Thanks Paul Nasrat.
+
+* Added progress meter for pip installation as well as setuptools. Thanks Ethan
+  Jucovy.
+
+* Added --never-download and --search-dir options. Thanks Ethan Jucovy.
+
+
+1.6
+~~~
+
+* Added Python 3 support! Huge thanks to Vinay Sajip and Vitaly Babiy.
+
+* Fixed creation of virtualenvs on Mac OS X when standard library modules
+  (readline) are installed outside the standard library.
+
+* Updated bundled pip to 1.0.
+
+
+1.5.2
+~~~~~
+
+* Moved main repository to Github: https://github.com/pypa/virtualenv
+
+* Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer and Brian Rosner
+
+* Fixed a few more pypy related bugs.
+
+* Updated bundled pip to 0.8.2.
+
+* Handed project over to new team of maintainers.
+
+* Moved virtualenv to Github at https://github.com/pypa/virtualenv
+
+
+1.5.1
+~~~~~
+
+* Added ``_weakrefset`` requirement for Python 2.7.1.
+
+* Fixed Windows regression in 1.5
+
+
+1.5
+~~~
+
+* Include pip 0.8.1.
+
+* Add support for PyPy.
+
+* Uses a proper temporary dir when installing environment requirements.
+
+* Add ``--prompt`` option to be able to override the default prompt prefix.
+
+* Fix an issue with ``--relocatable`` on Windows.
+
+* Fix issue with installing the wrong version of distribute.
+
+* Add fish and csh activate scripts.
+
+
+1.4.9
+~~~~~
+
+* Include pip 0.7.2
+
+
+1.4.8
+~~~~~
+
+* Fix for Mac OS X Framework builds that use
+  ``--universal-archs=intel``
+
+* Fix ``activate_this.py`` on Windows.
+
+* Allow ``$PYTHONHOME`` to be set, so long as you use ``source
+  bin/activate`` it will get unset; if you leave it set and do not
+  activate the environment it will still break the environment.
+
+* Include pip 0.7.1
+
+
+1.4.7
+~~~~~
+
+* Include pip 0.7
+
+
+1.4.6
+~~~~~
+
+* Allow ``activate.sh`` to skip updating the prompt (by setting
+  ``$VIRTUAL_ENV_DISABLE_PROMPT``).
+
+
+1.4.5
+~~~~~
+
+* Include pip 0.6.3
+
+* Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
+  ``PATH`` contained a parenthesis
+
+
+1.4.4
+~~~~~
+
+* Include pip 0.6.2 and Distribute 0.6.10
+
+* Create the ``virtualenv`` script even when Setuptools isn't
+  installed
+
+* Fix problem with ``virtualenv --relocate`` when ``bin/`` has
+  subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni.
+
+* If you set ``$VIRTUALENV_DISTRIBUTE`` then virtualenv will use
+  Distribute by default (so you don't have to remember to use
+  ``--distribute``).
+
+
+1.4.3
+~~~~~
+
+* Include pip 0.6.1
+
+
+1.4.2
+~~~~~
+
+* Fix pip installation on Windows
+
+* Fix use of stand-alone ``virtualenv.py`` (and boot scripts)
+
+* Exclude ~/.local (user site-packages) from environments when using
+  ``--no-site-packages``
+
+
+1.4.1
+~~~~~
+
+* Include pip 0.6
+
+
+1.4
+~~~
+
+* Updated setuptools to 0.6c11
+
+* Added the --distribute option
+
+* Fixed packaging problem of support-files
+
+
+1.3.4
+~~~~~
+
+* Virtualenv now copies the actual embedded Python binary on
+  Mac OS X to fix a hang on Snow Leopard (10.6).
+
+* Fail more gracefully on Windows when ``win32api`` is not installed.
+
+* Fix site-packages taking precedent over Jython's ``__classpath__``
+  and also specially handle the new ``__pyclasspath__`` entry in
+  ``sys.path``.
+
+* Now copies Jython's ``registry`` file to the virtualenv if it exists.
+
+* Better find libraries when compiling extensions on Windows.
+
+* Create ``Scripts\pythonw.exe`` on Windows.
+
+* Added support for the Debian/Ubuntu
+  ``/usr/lib/pythonX.Y/dist-packages`` directory.
+
+* Set ``distutils.sysconfig.get_config_vars()['LIBDIR']`` (based on
+  ``sys.real_prefix``) which is reported to help building on Windows.
+
+* Make ``deactivate`` work on ksh
+
+* Fixes for ``--python``: make it work with ``--relocatable`` and the
+  symlink created to the exact Python version.
+
+
+1.3.3
+~~~~~
+
+* Use Windows newlines in ``activate.bat``, which has been reported to help
+  when using non-ASCII directory names.
+
+* Fixed compatibility with Jython 2.5b1.
+
+* Added a function ``virtualenv.install_python`` for more fine-grained
+  access to what ``virtualenv.create_environment`` does.
+
+* Fix `a problem <https://bugs.launchpad.net/virtualenv/+bug/241581>`_
+  with Windows and paths that contain spaces.
+
+* If ``/path/to/env/.pydistutils.cfg`` exists (or
+  ``/path/to/env/pydistutils.cfg`` on Windows systems) then ignore
+  ``~/.pydistutils.cfg`` and use that other file instead.
+
+* Fix ` a problem
+  <https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
+  some ``.so`` libraries in ``/usr/local``.
+
+
+1.3.2
+~~~~~
+
+* Remove the ``[install] prefix = ...`` setting from the virtualenv
+  ``distutils.cfg`` -- this has been causing problems for a lot of
+  people, in rather obscure ways.
+
+* If you use a boot script it will attempt to import ``virtualenv``
+  and find a pre-downloaded Setuptools egg using that.
+
+* Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2``
+
+
+1.3.1
+~~~~~
+
+* Real Python 2.6 compatibility.  Backported the Python 2.6 updates to
+  ``site.py``, including `user directories
+  <http://docs.python.org/dev/whatsnew/2.6.html#pep-370-per-user-site-packages-directory>`_
+  (this means older versions of Python will support user directories,
+  whether intended or not).
+
+* Always set ``[install] prefix`` in ``distutils.cfg`` -- previously
+  on some platforms where a system-wide ``distutils.cfg`` was present
+  with a ``prefix`` setting, packages would be installed globally
+  (usually in ``/usr/local/lib/pythonX.Y/site-packages``).
+
+* Sometimes Cygwin seems to leave ``.exe`` off ``sys.executable``; a
+  workaround is added.
+
+* Fix ``--python`` option.
+
+* Fixed handling of Jython environments that use a
+  jython-complete.jar.
+
+
+1.3
+~~~
+
+* Update to Setuptools 0.6c9
+* Added an option ``virtualenv --relocatable EXISTING_ENV``, which
+  will make an existing environment "relocatable" -- the paths will
+  not be absolute in scripts, ``.egg-info`` and ``.pth`` files.  This
+  may assist in building environments that can be moved and copied.
+  You have to run this *after* any new packages installed.
+* Added ``bin/activate_this.py``, a file you can use like
+  ``execfile("path_to/activate_this.py",
+  dict(__file__="path_to/activate_this.py"))`` -- this will activate
+  the environment in place, similar to what `the mod_wsgi example
+  does <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
+* For Mac framework builds of Python, the site-packages directory
+  ``/Library/Python/X.Y/site-packages`` is added to ``sys.path``, from
+  Andrea Rech.
+* Some platform-specific modules in Macs are added to the path now
+  (``plat-darwin/``, ``plat-mac/``, ``plat-mac/lib-scriptpackages``),
+  from Andrea Rech.
+* Fixed a small Bashism in the ``bin/activate`` shell script.
+* Added ``__future__`` to the list of required modules, for Python
+  2.3.  You'll still need to backport your own ``subprocess`` module.
+* Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
+  precedent over virtualenv's libs.
+
+
+1.2
+~~~
+
+* Added a ``--python`` option to select the Python interpreter.
+* Add ``warnings`` to the modules copied over, for Python 2.6 support.
+* Add ``sets`` to the module copied over for Python 2.3 (though Python
+  2.3 still probably doesn't work).
+
+
+1.1.1
+~~~~~
+
+* Added support for Jython 2.5.
+
+
+1.1
+~~~
+
+* Added support for Python 2.6.
+* Fix a problem with missing ``DLLs/zlib.pyd`` on Windows.  Create
+* ``bin/python`` (or ``bin/python.exe``) even when you run virtualenv
+  with an interpreter named, e.g., ``python2.4``
+* Fix MacPorts Python
+* Added --unzip-setuptools option
+* Update to Setuptools 0.6c8
+* If the current directory is not writable, run ez_setup.py in ``/tmp``
+* Copy or symlink over the ``include`` directory so that packages will
+  more consistently compile.
+
+
+1.0
+~~~
+
+* Fix build on systems that use ``/usr/lib64``, distinct from
+  ``/usr/lib`` (specifically CentOS x64).
+* Fixed bug in ``--clear``.
+* Fixed typos in ``deactivate.bat``.
+* Preserve ``$PYTHONPATH`` when calling subprocesses.
+
+
+0.9.2
+~~~~~
+
+* Fix include dir copying on Windows (makes compiling possible).
+* Include the main ``lib-tk`` in the path.
+* Patch ``distutils.sysconfig``: ``get_python_inc`` and
+  ``get_python_lib`` to point to the global locations.
+* Install ``distutils.cfg`` before Setuptools, so that system
+  customizations of ``distutils.cfg`` won't effect the installation.
+* Add ``bin/pythonX.Y`` to the virtualenv (in addition to
+  ``bin/python``).
+* Fixed an issue with Mac Framework Python builds, and absolute paths
+  (from Ronald Oussoren).
+
+
+0.9.1
+~~~~~
+
+* Improve ability to create a virtualenv from inside a virtualenv.
+* Fix a little bug in ``bin/activate``.
+* Actually get ``distutils.cfg`` to work reliably.
+
+
+0.9
+~~~
+
+* Added ``lib-dynload`` and ``config`` to things that need to be
+  copied over in an environment.
+* Copy over or symlink the ``include`` directory, so that you can
+  build packages that need the C headers.
+* Include a ``distutils`` package, so you can locally update
+  ``distutils.cfg`` (in ``lib/pythonX.Y/distutils/distutils.cfg``).
+* Better avoid downloading Setuptools, and hitting PyPI on environment
+  creation.
+* Fix a problem creating a ``lib64/`` directory.
+* Should work on MacOSX Framework builds (the default Python
+  installations on Mac).  Thanks to Ronald Oussoren.
+
+
+0.8.4
+~~~~~
+
+* Windows installs would sometimes give errors about ``sys.prefix`` that
+  were inaccurate.
+* Slightly prettier output.
+
+
+0.8.3
+~~~~~
+
+* Added support for Windows.
+
+
+0.8.2
+~~~~~
+
+* Give a better warning if you are on an unsupported platform (Mac
+  Framework Pythons, and Windows).
+* Give error about running while inside a workingenv.
+* Give better error message about Python 2.3.
+
+
+0.8.1
+~~~~~
+
+Fixed packaging of the library.
+
+
+0.8
+~~~
+
+Initial release.  Everything is changed and new!
deleted file mode 100644
--- a/python/virtualenv/docs/news.txt
+++ /dev/null
@@ -1,626 +0,0 @@
-Changes & News
---------------
-
-.. warning::
-
-   Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that
-   will cause "import random" to fail with "cannot import name urandom" on any
-   virtualenv created on a Unix host with an earlier release of Python
-   2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to
-   the fact that a virtualenv uses the system Python's standard library but
-   contains its own copy of the Python interpreter, so an upgrade to the system
-   Python results in a mismatch between the version of the Python interpreter
-   and the version of the standard library. It can be fixed by removing
-   ``$ENV/bin/python`` and re-running virtualenv on the same target directory
-   with the upgraded Python.
-
-1.8.4 (2012-11-25)
-~~~~~~~~~~~~~~~~~~
-
-* Updated distribute to 0.6.31. This fixes #359 (numpy install regression) on
-  UTF-8 platforms, and provides a workaround on other platforms:
-  ``PYTHONIOENCODING=utf8 pip install numpy``.
-
-* When installing virtualenv via curl, don't forget to filter out arguments
-  the distribute setup script won't understand. Fixes #358.
-
-* Added some more integration tests.
-
-1.8.3 (2012-11-21)
-~~~~~~~~~~~~~~~~~~
-
-* Fixed readline on OS X. Thanks minrk
-
-* Updated distribute to 0.6.30 (improves our error reporting, plus new
-  distribute features and fixes). Thanks Gabriel (g2p)
-
-* Added compatibility with multiarch Python (Python 3.3 for example). Added an
-  integration test. Thanks Gabriel (g2p)
-
-* Added ability to install distribute from a user-provided egg, rather than the
-  bundled sdist, for better speed. Thanks Paul Moore.
-
-* Make the creation of lib64 symlink smarter about already-existing symlink,
-  and more explicit about full paths. Fixes #334 and #330. Thanks Jeremy Orem.
-
-* Give lib64 site-dir preference over lib on 64-bit systems, to avoid wrong
-  32-bit compiles in the venv. Fixes #328. Thanks Damien Nozay.
-
-* Fix a bug with prompt-handling in ``activate.csh`` in non-interactive csh
-  shells. Fixes #332. Thanks Benjamin Root for report and patch.
-
-* Make it possible to create a virtualenv from within a Python
-  3.3. pyvenv. Thanks Chris McDonough for the report.
-
-* Add optional --setuptools option to be able to switch to it in case
-  distribute is the default (like in Debian).
-
-1.8.2 (2012-09-06)
-~~~~~~~~~~~~~~~~~~
-
-* Updated the included pip version to 1.2.1 to fix regressions introduced
-  there in 1.2.
-
-
-1.8.1 (2012-09-03)
-~~~~~~~~~~~~~~~~~~
-
-* Fixed distribute version used with `--never-download`. Thanks michr for
-  report and patch.
-
-* Fix creating Python 3.3 based virtualenvs by unsetting the
-  ``__PYVENV_LAUNCHER__`` environment variable in subprocesses.
-
-
-1.8 (2012-09-01)
-~~~~~~~~~~~~~~~~
-
-* **Dropped support for Python 2.4** The minimum supported Python version is
-  now Python 2.5.
-
-* Fix `--relocatable` on systems that use lib64. Fixes #78. Thanks Branden
-  Rolston.
-
-* Symlink some additional modules under Python 3. Fixes #194. Thanks Vinay
-  Sajip, Ian Clelland, and Stefan Holek for the report.
-
-* Fix ``--relocatable`` when a script uses ``__future__`` imports. Thanks
-  Branden Rolston.
-
-* Fix a bug in the config option parser that prevented setting negative
-  options with environemnt variables. Thanks Ralf Schmitt.
-
-* Allow setting ``--no-site-packages`` from the config file.
-
-* Use ``/usr/bin/multiarch-platform`` if available to figure out the include
-  directory. Thanks for the patch, Mika Laitio.
-
-* Fix ``install_name_tool`` replacement to work on Python 3.X.
-
-* Handle paths of users' site-packages on Mac OS X correctly when changing
-  the prefix.
-
-* Updated the embedded version of distribute to 0.6.28 and pip to 1.2.
-
-
-1.7.2 (2012-06-22)
-~~~~~~~~~~~~~~~~~~
-
-* Updated to distribute 0.6.27.
-
-* Fix activate.fish on OS X. Fixes #8. Thanks David Schoonover.
-
-* Create a virtualenv-x.x script with the Python version when installing, so
-  virtualenv for multiple Python versions can be installed to the same
-  script location. Thanks Miki Tebeka.
-
-* Restored ability to create a virtualenv with a path longer than 78
-  characters, without breaking creation of virtualenvs with non-ASCII paths.
-  Thanks, Bradley Ayers.
-
-* Added ability to create virtualenvs without having installed Apple's
-  developers tools (using an own implementation of ``install_name_tool``).
-  Thanks Mike Hommey.
-
-* Fixed PyPy and Jython support on Windows. Thanks Konstantin Zemlyak.
-
-* Added pydoc script to ease use. Thanks Marc Abramowitz. Fixes #149.
-
-* Fixed creating a bootstrap script on Python 3. Thanks Raul Leal. Fixes #280.
-
-* Fixed inconsistency when having set the ``PYTHONDONTWRITEBYTECODE`` env var
-  with the --distribute option or the ``VIRTUALENV_USE_DISTRIBUTE`` env var.
-  ``VIRTUALENV_USE_DISTRIBUTE`` is now considered again as a legacy alias.
-
-
-1.7.1.2 (2012-02-17)
-~~~~~~~~~~~~~~~~~~~~
-
-* Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat.
-
-
-1.7.1.1 (2012-02-16)
-~~~~~~~~~~~~~~~~~~~~
-
-* Bumped the version string in ``virtualenv.py`` up, too.
-
-* Fixed rST rendering bug of long description.
-
-
-1.7.1 (2012-02-16)
-~~~~~~~~~~~~~~~~~~
-
-* Update embedded pip to version 1.1.
-
-* Fix `--relocatable` under Python 3. Thanks Doug Hellmann.
-
-* Added environ PATH modification to activate_this.py. Thanks Doug
-  Napoleone. Fixes #14.
-
-* Support creating virtualenvs directly from a Python build directory on
-  Windows. Thanks CBWhiz. Fixes #139.
-
-* Use non-recursive symlinks to fix things up for posix_local install
-  scheme. Thanks michr.
-
-* Made activate script available for use with msys and cygwin on Windows.
-  Thanks Greg Haskins, Cliff Xuan, Jonathan Griffin and Doug Napoleone.
-  Fixes #176.
-
-* Fixed creation of virtualenvs on Windows when Python is not installed for
-  all users. Thanks Anatoly Techtonik for report and patch and Doug
-  Napoleone for testing and confirmation. Fixes #87.
-
-* Fixed creation of virtualenvs using -p in installs where some modules
-  that ought to be in the standard library (e.g. `readline`) are actually
-  installed in `site-packages` next to `virtualenv.py`. Thanks Greg Haskins
-  for report and fix. Fixes #167.
-
-* Added activation script for Powershell (signed by Jannis Leidel). Many
-  thanks to Jason R. Coombs.
-
-
-1.7 (2011-11-30)
-~~~~~~~~~~~~~~~~
-
-* Gave user-provided ``--extra-search-dir`` priority over default dirs for
-  finding setuptools/distribute (it already had priority for finding pip).
-  Thanks Ethan Jucovy.
-
-* Updated embedded Distribute release to 0.6.24. Thanks Alex Gronholm.
-
-* Made ``--no-site-packages`` behavior the default behavior.  The
-  ``--no-site-packages`` flag is still permitted, but displays a warning when
-  used. Thanks Chris McDonough.
-
-* New flag: ``--system-site-packages``; this flag should be passed to get the
-  previous default global-site-package-including behavior back.
-
-* Added ability to set command options as environment variables and options
-  in a ``virtualenv.ini`` file.
-
-* Fixed various encoding related issues with paths. Thanks Gunnlaugur Thor Briem.
-
-* Made ``virtualenv.py`` script executable.
-
-
-1.6.4 (2011-07-21)
-~~~~~~~~~~~~~~~~~~
-
-* Restored ability to run on Python 2.4, too.
-
-
-1.6.3 (2011-07-16)
-~~~~~~~~~~~~~~~~~~
-
-* Restored ability to run on Python < 2.7.
-
-
-1.6.2 (2011-07-16)
-~~~~~~~~~~~~~~~~~~
-
-* Updated embedded distribute release to 0.6.19.
-
-* Updated embedded pip release to 1.0.2.
-
-* Fixed #141 - Be smarter about finding pkg_resources when using the
-  non-default Python intepreter (by using the ``-p`` option).
-
-* Fixed #112 - Fixed path in docs.
-
-* Fixed #109 - Corrected doctests of a Logger method.
-
-* Fixed #118 - Fixed creating virtualenvs on platforms that use the
-  "posix_local" install scheme, such as Ubuntu with Python 2.7.
-
-* Add missing library to Python 3 virtualenvs (``_dummy_thread``).
-
-
-1.6.1 (2011-04-30)
-~~~~~~~~~~~~~~~~~~
-
-* Start to use git-flow.
-
-* Added support for PyPy 1.5
-
-* Fixed #121 -- added sanity-checking of the -p argument. Thanks Paul Nasrat.
-
-* Added progress meter for pip installation as well as setuptools. Thanks Ethan
-  Jucovy.
-
-* Added --never-download and --search-dir options. Thanks Ethan Jucovy.
-
-
-1.6
-~~~
-
-* Added Python 3 support! Huge thanks to Vinay Sajip and Vitaly Babiy.
-
-* Fixed creation of virtualenvs on Mac OS X when standard library modules
-  (readline) are installed outside the standard library.
-
-* Updated bundled pip to 1.0.
-
-
-1.5.2
-~~~~~
-
-* Moved main repository to Github: https://github.com/pypa/virtualenv
-
-* Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer and Brian Rosner
-
-* Fixed a few more pypy related bugs.
-
-* Updated bundled pip to 0.8.2.
-
-* Handed project over to new team of maintainers.
-
-* Moved virtualenv to Github at https://github.com/pypa/virtualenv
-
-
-1.5.1
-~~~~~
-
-* Added ``_weakrefset`` requirement for Python 2.7.1.
-
-* Fixed Windows regression in 1.5
-
-
-1.5
-~~~
-
-* Include pip 0.8.1.
-
-* Add support for PyPy.
-
-* Uses a proper temporary dir when installing environment requirements.
-
-* Add ``--prompt`` option to be able to override the default prompt prefix.
-
-* Fix an issue with ``--relocatable`` on Windows.
-
-* Fix issue with installing the wrong version of distribute.
-
-* Add fish and csh activate scripts.
-
-
-1.4.9
-~~~~~
-
-* Include pip 0.7.2
-
-
-1.4.8
-~~~~~
-
-* Fix for Mac OS X Framework builds that use
-  ``--universal-archs=intel``
-
-* Fix ``activate_this.py`` on Windows.
-
-* Allow ``$PYTHONHOME`` to be set, so long as you use ``source
-  bin/activate`` it will get unset; if you leave it set and do not
-  activate the environment it will still break the environment.
-
-* Include pip 0.7.1
-
-
-1.4.7
-~~~~~
-
-* Include pip 0.7
-
-
-1.4.6
-~~~~~
-
-* Allow ``activate.sh`` to skip updating the prompt (by setting
-  ``$VIRTUAL_ENV_DISABLE_PROMPT``).
-
-
-1.4.5
-~~~~~
-
-* Include pip 0.6.3
-
-* Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
-  ``PATH`` contained a parenthesis
-
-
-1.4.4
-~~~~~
-
-* Include pip 0.6.2 and Distribute 0.6.10
-
-* Create the ``virtualenv`` script even when Setuptools isn't
-  installed
-
-* Fix problem with ``virtualenv --relocate`` when ``bin/`` has
-  subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni.
-
-* If you set ``$VIRTUALENV_DISTRIBUTE`` then virtualenv will use
-  Distribute by default (so you don't have to remember to use
-  ``--distribute``).
-
-
-1.4.3
-~~~~~
-
-* Include pip 0.6.1
-
-
-1.4.2
-~~~~~
-
-* Fix pip installation on Windows
-
-* Fix use of stand-alone ``virtualenv.py`` (and boot scripts)
-
-* Exclude ~/.local (user site-packages) from environments when using
-  ``--no-site-packages``
-
-
-1.4.1
-~~~~~
-
-* Include pip 0.6
-
-
-1.4
-~~~
-
-* Updated setuptools to 0.6c11
-
-* Added the --distribute option
-
-* Fixed packaging problem of support-files
-
-
-1.3.4
-~~~~~
-
-* Virtualenv now copies the actual embedded Python binary on
-  Mac OS X to fix a hang on Snow Leopard (10.6).
-
-* Fail more gracefully on Windows when ``win32api`` is not installed.
-
-* Fix site-packages taking precedent over Jython's ``__classpath__``
-  and also specially handle the new ``__pyclasspath__`` entry in
-  ``sys.path``.
-
-* Now copies Jython's ``registry`` file to the virtualenv if it exists.
-
-* Better find libraries when compiling extensions on Windows.
-
-* Create ``Scripts\pythonw.exe`` on Windows.
-
-* Added support for the Debian/Ubuntu
-  ``/usr/lib/pythonX.Y/dist-packages`` directory.
-
-* Set ``distutils.sysconfig.get_config_vars()['LIBDIR']`` (based on
-  ``sys.real_prefix``) which is reported to help building on Windows.
-
-* Make ``deactivate`` work on ksh
-
-* Fixes for ``--python``: make it work with ``--relocatable`` and the
-  symlink created to the exact Python version.
-
-
-1.3.3
-~~~~~
-
-* Use Windows newlines in ``activate.bat``, which has been reported to help
-  when using non-ASCII directory names.
-
-* Fixed compatibility with Jython 2.5b1.
-
-* Added a function ``virtualenv.install_python`` for more fine-grained
-  access to what ``virtualenv.create_environment`` does.
-
-* Fix `a problem <https://bugs.launchpad.net/virtualenv/+bug/241581>`_
-  with Windows and paths that contain spaces.
-
-* If ``/path/to/env/.pydistutils.cfg`` exists (or
-  ``/path/to/env/pydistutils.cfg`` on Windows systems) then ignore
-  ``~/.pydistutils.cfg`` and use that other file instead.
-
-* Fix ` a problem
-  <https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
-  some ``.so`` libraries in ``/usr/local``.
-
-
-1.3.2
-~~~~~
-
-* Remove the ``[install] prefix = ...`` setting from the virtualenv
-  ``distutils.cfg`` -- this has been causing problems for a lot of
-  people, in rather obscure ways.
-
-* If you use a boot script it will attempt to import ``virtualenv``
-  and find a pre-downloaded Setuptools egg using that.
-
-* Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2``
-
-
-1.3.1
-~~~~~
-
-* Real Python 2.6 compatibility.  Backported the Python 2.6 updates to
-  ``site.py``, including `user directories
-  <http://docs.python.org/dev/whatsnew/2.6.html#pep-370-per-user-site-packages-directory>`_
-  (this means older versions of Python will support user directories,
-  whether intended or not).
-
-* Always set ``[install] prefix`` in ``distutils.cfg`` -- previously
-  on some platforms where a system-wide ``distutils.cfg`` was present
-  with a ``prefix`` setting, packages would be installed globally
-  (usually in ``/usr/local/lib/pythonX.Y/site-packages``).
-
-* Sometimes Cygwin seems to leave ``.exe`` off ``sys.executable``; a
-  workaround is added.
-
-* Fix ``--python`` option.
-
-* Fixed handling of Jython environments that use a
-  jython-complete.jar.
-
-
-1.3
-~~~
-
-* Update to Setuptools 0.6c9
-* Added an option ``virtualenv --relocatable EXISTING_ENV``, which
-  will make an existing environment "relocatable" -- the paths will
-  not be absolute in scripts, ``.egg-info`` and ``.pth`` files.  This
-  may assist in building environments that can be moved and copied.
-  You have to run this *after* any new packages installed.
-* Added ``bin/activate_this.py``, a file you can use like
-  ``execfile("path_to/activate_this.py",
-  dict(__file__="path_to/activate_this.py"))`` -- this will activate
-  the environment in place, similar to what `the mod_wsgi example
-  does <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
-* For Mac framework builds of Python, the site-packages directory
-  ``/Library/Python/X.Y/site-packages`` is added to ``sys.path``, from
-  Andrea Rech.
-* Some platform-specific modules in Macs are added to the path now
-  (``plat-darwin/``, ``plat-mac/``, ``plat-mac/lib-scriptpackages``),
-  from Andrea Rech.
-* Fixed a small Bashism in the ``bin/activate`` shell script.
-* Added ``__future__`` to the list of required modules, for Python
-  2.3.  You'll still need to backport your own ``subprocess`` module.
-* Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
-  precedent over virtualenv's libs.
-
-
-1.2
-~~~
-
-* Added a ``--python`` option to select the Python interpreter.
-* Add ``warnings`` to the modules copied over, for Python 2.6 support.
-* Add ``sets`` to the module copied over for Python 2.3 (though Python
-  2.3 still probably doesn't work).
-
-
-1.1.1
-~~~~~
-
-* Added support for Jython 2.5.
-
-
-1.1
-~~~
-
-* Added support for Python 2.6.
-* Fix a problem with missing ``DLLs/zlib.pyd`` on Windows.  Create
-* ``bin/python`` (or ``bin/python.exe``) even when you run virtualenv
-  with an interpreter named, e.g., ``python2.4``
-* Fix MacPorts Python
-* Added --unzip-setuptools option
-* Update to Setuptools 0.6c8
-* If the current directory is not writable, run ez_setup.py in ``/tmp``
-* Copy or symlink over the ``include`` directory so that packages will
-  more consistently compile.
-
-
-1.0
-~~~
-
-* Fix build on systems that use ``/usr/lib64``, distinct from
-  ``/usr/lib`` (specifically CentOS x64).
-* Fixed bug in ``--clear``.
-* Fixed typos in ``deactivate.bat``.
-* Preserve ``$PYTHONPATH`` when calling subprocesses.
-
-
-0.9.2
-~~~~~
-
-* Fix include dir copying on Windows (makes compiling possible).
-* Include the main ``lib-tk`` in the path.
-* Patch ``distutils.sysconfig``: ``get_python_inc`` and
-  ``get_python_lib`` to point to the global locations.
-* Install ``distutils.cfg`` before Setuptools, so that system
-  customizations of ``distutils.cfg`` won't effect the installation.
-* Add ``bin/pythonX.Y`` to the virtualenv (in addition to
-  ``bin/python``).
-* Fixed an issue with Mac Framework Python builds, and absolute paths
-  (from Ronald Oussoren).
-
-
-0.9.1
-~~~~~
-
-* Improve ability to create a virtualenv from inside a virtualenv.
-* Fix a little bug in ``bin/activate``.
-* Actually get ``distutils.cfg`` to work reliably.
-
-
-0.9
-~~~
-
-* Added ``lib-dynload`` and ``config`` to things that need to be
-  copied over in an environment.
-* Copy over or symlink the ``include`` directory, so that you can
-  build packages that need the C headers.
-* Include a ``distutils`` package, so you can locally update
-  ``distutils.cfg`` (in ``lib/pythonX.Y/distutils/distutils.cfg``).
-* Better avoid downloading Setuptools, and hitting PyPI on environment
-  creation.
-* Fix a problem creating a ``lib64/`` directory.
-* Should work on MacOSX Framework builds (the default Python
-  installations on Mac).  Thanks to Ronald Oussoren.
-
-
-0.8.4
-~~~~~
-
-* Windows installs would sometimes give errors about ``sys.prefix`` that
-  were inaccurate.
-* Slightly prettier output.
-
-
-0.8.3
-~~~~~
-
-* Added support for Windows.
-
-
-0.8.2
-~~~~~
-
-* Give a better warning if you are on an unsupported platform (Mac
-  Framework Pythons, and Windows).
-* Give error about running while inside a workingenv.
-* Give better error message about Python 2.3.
-
-
-0.8.1
-~~~~~
-
-Fixed packaging of the library.
-
-
-0.8
-~~~
-
-Initial release.  Everything is changed and new!
--- a/python/virtualenv/setup.py
+++ b/python/virtualenv/setup.py
@@ -25,21 +25,21 @@ except ImportError:
         script = 'scripts/virtualenv'
         script_ver = script + '-%s.%s' % sys.version_info[:2]
         shutil.copy(script, script_ver)
         setup_params = {'scripts': [script, script_ver]}
 
 here = os.path.dirname(os.path.abspath(__file__))
 
 ## Get long_description from index.txt:
-f = open(os.path.join(here, 'docs', 'index.txt'))
+f = open(os.path.join(here, 'docs', 'index.rst'))
 long_description = f.read().strip()
 long_description = long_description.split('split here', 1)[1]
 f.close()
-f = open(os.path.join(here, 'docs', 'news.txt'))
+f = open(os.path.join(here, 'docs', 'news.rst'))
 long_description += "\n\n" + f.read()
 f.close()
 
 
 def get_version():
     f = open(os.path.join(here, 'virtualenv.py'))
     version_file = f.read()
     f.close()
@@ -56,23 +56,21 @@ def get_version():
 # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
 try:
     import multiprocessing
 except ImportError:
     pass
 
 setup(
     name='virtualenv',
-    # If you change the version here, change it in virtualenv.py and
-    # docs/conf.py as well
     version=get_version(),
     description="Virtual Python Environment builder",
     long_description=long_description,
     classifiers=[
-        'Development Status :: 4 - Beta',
+        'Development Status :: 5 - Production/Stable',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: MIT License',
         'Programming Language :: Python :: 2',
         'Programming Language :: Python :: 2.5',
         'Programming Language :: Python :: 2.6',
         'Programming Language :: Python :: 2.7',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 3.1',
--- a/python/virtualenv/virtualenv.py
+++ b/python/virtualenv/virtualenv.py
@@ -1,16 +1,14 @@
 #!/usr/bin/env python
 """Create a "virtual" Python installation
 """
 
-# If you change the version here, change it in setup.py
-# and docs/conf.py as well.
-__version__ = "1.8.4"  # following best practices
-virtualenv_version = __version__  # legacy, again
+__version__ = "1.10.1"
+virtualenv_version = __version__  # legacy
 
 import base64
 import sys
 import os
 import codecs
 import optparse
 import re
 import shutil
@@ -18,20 +16,21 @@ import logging
 import tempfile
 import zlib
 import errno
 import glob
 import distutils.sysconfig
 from distutils.util import strtobool
 import struct
 import subprocess
+import tarfile
 
-if sys.version_info < (2, 5):
+if sys.version_info < (2, 6):
     print('ERROR: %s' % sys.exc_info()[1])
-    print('ERROR: this script requires Python 2.5 or greater.')
+    print('ERROR: this script requires Python 2.6 or greater.')
     sys.exit(101)
 
 try:
     set
 except NameError:
     from sets import Set as set
 try:
     basestring
@@ -62,16 +61,52 @@ default_config_file = os.path.join(defau
 
 if is_pypy:
     expected_exe = 'pypy'
 elif is_jython:
     expected_exe = 'jython'
 else:
     expected_exe = 'python'
 
+# Return a mapping of version -> Python executable
+# Only provided for Windows, where the information in the registry is used
+if not is_win:
+    def get_installed_pythons():
+        return {}
+else:
+    try:
+        import winreg
+    except ImportError:
+        import _winreg as winreg
+
+    def get_installed_pythons():
+        python_core = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE,
+                "Software\\Python\\PythonCore")
+        i = 0
+        versions = []
+        while True:
+            try:
+                versions.append(winreg.EnumKey(python_core, i))
+                i = i + 1
+            except WindowsError:
+                break
+        exes = dict()
+        for ver in versions:
+            path = winreg.QueryValue(python_core, "%s\\InstallPath" % ver)
+            exes[ver] = join(path, "python.exe")
+
+        winreg.CloseKey(python_core)
+
+        # Add the major versions
+        # Sort the keys, then repeatedly update the major version entry
+        # Last executable (i.e., highest version) wins with this approach
+        for ver in sorted(exes):
+            exes[ver[0]] = exes[ver]
+
+        return exes
 
 REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath',
                     'fnmatch', 'locale', 'encodings', 'codecs',
                     'stat', 'UserDict', 'readline', 'copy_reg', 'types',
                     're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile',
                     'zlib']
 
 REQUIRED_FILES = ['lib-dynload', 'config']
@@ -402,47 +437,47 @@ logger = Logger([(Logger.LEVELS[-1], sys
 
 def mkdir(path):
     if not os.path.exists(path):
         logger.info('Creating %s', path)
         os.makedirs(path)
     else:
         logger.info('Directory %s already exists', path)
 
-def copyfileordir(src, dest):
+def copyfileordir(src, dest, symlink=True):
     if os.path.isdir(src):
-        shutil.copytree(src, dest, True)
+        shutil.copytree(src, dest, symlink)
     else:
         shutil.copy2(src, dest)
 
 def copyfile(src, dest, symlink=True):
     if not os.path.exists(src):
         # Some bad symlink in the src
         logger.warn('Cannot find file %s (bad symlink)', src)
         return
     if os.path.exists(dest):
         logger.debug('File %s already exists', dest)
         return
     if not os.path.exists(os.path.dirname(dest)):
-        logger.info('Creating parent directories for %s' % os.path.dirname(dest))
+        logger.info('Creating parent directories for %s', os.path.dirname(dest))
         os.makedirs(os.path.dirname(dest))
     if not os.path.islink(src):
         srcpath = os.path.abspath(src)
     else:
         srcpath = os.readlink(src)
     if symlink and hasattr(os, 'symlink') and not is_win:
         logger.info('Symlinking %s', dest)
         try:
             os.symlink(srcpath, dest)
         except (OSError, NotImplementedError):
             logger.info('Symlinking failed, copying to %s', dest)
-            copyfileordir(src, dest)
+            copyfileordir(src, dest, symlink)
     else:
         logger.info('Copying to %s', dest)
-        copyfileordir(src, dest)
+        copyfileordir(src, dest, symlink)
 
 def writefile(dest, content, overwrite=True):
     if not os.path.exists(dest):
         logger.info('Writing %s', dest)
         f = open(dest, 'wb')
         f.write(content.encode('utf-8'))
         f.close()
         return
@@ -477,238 +512,46 @@ def make_exe(fn):
 
 def _find_file(filename, dirs):
     for dir in reversed(dirs):
         files = glob.glob(os.path.join(dir, filename))
         if files and os.path.isfile(files[0]):
             return True, files[0]
     return False, filename
 
-def _install_req(py_executable, unzip=False, distribute=False,
-                 search_dirs=None, never_download=False):
-
-    if search_dirs is None:
-        search_dirs = file_search_dirs()
-
-    if not distribute:
-        egg_path = 'setuptools-*-py%s.egg' % sys.version[:3]
-        found, egg_path = _find_file(egg_path, search_dirs)
-        project_name = 'setuptools'
-        bootstrap_script = EZ_SETUP_PY
-        tgz_path = None
-    else:
-        # Look for a distribute egg (these are not distributed by default,
-        # but can be made available by the user)
-        egg_path = 'distribute-*-py%s.egg' % sys.version[:3]
-        found, egg_path = _find_file(egg_path, search_dirs)
-        project_name = 'distribute'
-        if found:
-            tgz_path = None
-            bootstrap_script = DISTRIBUTE_FROM_EGG_PY
-        else:
-            # Fall back to sdist
-            # NB: egg_path is not None iff tgz_path is None
-            # iff bootstrap_script is a generic setup script accepting
-            # the standard arguments.
-            egg_path = None
-            tgz_path = 'distribute-*.tar.gz'
-            found, tgz_path = _find_file(tgz_path, search_dirs)
-            bootstrap_script = DISTRIBUTE_SETUP_PY
-
-    if is_jython and os._name == 'nt':
-        # Jython's .bat sys.executable can't handle a command line
-        # argument with newlines
-        fd, ez_setup = tempfile.mkstemp('.py')
-        os.write(fd, bootstrap_script)
-        os.close(fd)
-        cmd = [py_executable, ez_setup]
-    else:
-        cmd = [py_executable, '-c', bootstrap_script]
-    if unzip and egg_path:
-        cmd.append('--always-unzip')
-    env = {}
-    remove_from_env = ['__PYVENV_LAUNCHER__']
-    if logger.stdout_level_matches(logger.DEBUG) and egg_path:
-        cmd.append('-v')
-
-    old_chdir = os.getcwd()
-    if egg_path is not None and os.path.exists(egg_path):
-        logger.info('Using existing %s egg: %s' % (project_name, egg_path))
-        cmd.append(egg_path)
-        if os.environ.get('PYTHONPATH'):
-            env['PYTHONPATH'] = egg_path + os.path.pathsep + os.environ['PYTHONPATH']
-        else:
-            env['PYTHONPATH'] = egg_path
-    elif tgz_path is not None and os.path.exists(tgz_path):
-        # Found a tgz source dist, let's chdir
-        logger.info('Using existing %s egg: %s' % (project_name, tgz_path))
-        os.chdir(os.path.dirname(tgz_path))
-        # in this case, we want to be sure that PYTHONPATH is unset (not
-        # just empty, really unset), else CPython tries to import the
-        # site.py that it's in virtualenv_support
-        remove_from_env.append('PYTHONPATH')
-    elif never_download:
-        logger.fatal("Can't find any local distributions of %s to install "
-                     "and --never-download is set.  Either re-run virtualenv "
-                     "without the --never-download option, or place a %s "
-                     "distribution (%s) in one of these "
-                     "locations: %r" % (project_name, project_name,
-                                        egg_path or tgz_path,
-                                        search_dirs))
-        sys.exit(1)
-    elif egg_path:
-        logger.info('No %s egg found; downloading' % project_name)
-        cmd.extend(['--always-copy', '-U', project_name])
-    else:
-        logger.info('No %s tgz found; downloading' % project_name)
-    logger.start_progress('Installing %s...' % project_name)
-    logger.indent += 2
-    cwd = None
-    if project_name == 'distribute':
-        env['DONT_PATCH_SETUPTOOLS'] = 'true'
-
-    def _filter_ez_setup(line):
-        return filter_ez_setup(line, project_name)
-
-    if not os.access(os.getcwd(), os.W_OK):
-        cwd = tempfile.mkdtemp()
-        if tgz_path is not None and os.path.exists(tgz_path):
-            # the current working dir is hostile, let's copy the
-            # tarball to a temp dir
-            target = os.path.join(cwd, os.path.split(tgz_path)[-1])
-            shutil.copy(tgz_path, target)
-    try:
-        call_subprocess(cmd, show_stdout=False,
-                        filter_stdout=_filter_ez_setup,
-                        extra_env=env,
-                        remove_from_env=remove_from_env,
-                        cwd=cwd)
-    finally:
-        logger.indent -= 2
-        logger.end_progress()
-        if cwd is not None:
-            shutil.rmtree(cwd)
-        if os.getcwd() != old_chdir:
-            os.chdir(old_chdir)
-        if is_jython and os._name == 'nt':
-            os.remove(ez_setup)
-
 def file_search_dirs():
     here = os.path.dirname(os.path.abspath(__file__))
     dirs = ['.', here,
             join(here, 'virtualenv_support')]
     if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv':
         # Probably some boot script; just in case virtualenv is installed...
         try:
             import virtualenv
         except ImportError:
             pass
         else:
             dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support'))
     return [d for d in dirs if os.path.isdir(d)]
 
-def install_setuptools(py_executable, unzip=False,
-                       search_dirs=None, never_download=False):
-    _install_req(py_executable, unzip,
-                 search_dirs=search_dirs, never_download=never_download)
-
-def install_distribute(py_executable, unzip=False,
-                       search_dirs=None, never_download=False):
-    _install_req(py_executable, unzip, distribute=True,
-                 search_dirs=search_dirs, never_download=never_download)
-
-_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I)
-def install_pip(py_executable, search_dirs=None, never_download=False):
-    if search_dirs is None:
-        search_dirs = file_search_dirs()
-
-    filenames = []
-    for dir in search_dirs:
-        filenames.extend([join(dir, fn) for fn in os.listdir(dir)
-                          if _pip_re.search(fn)])
-    filenames = [(os.path.basename(filename).lower(), i, filename) for i, filename in enumerate(filenames)]
-    filenames.sort()
-    filenames = [filename for basename, i, filename in filenames]
-    if not filenames:
-        filename = 'pip'
-    else:
-        filename = filenames[-1]
-    easy_install_script = 'easy_install'
-    if is_win:
-        easy_install_script = 'easy_install-script.py'
-    # There's two subtle issues here when invoking easy_install.
-    # 1. On unix-like systems the easy_install script can *only* be executed
-    #    directly if its full filesystem path is no longer than 78 characters.
-    # 2. A work around to [1] is to use the `python path/to/easy_install foo`
-    #    pattern, but that breaks if the path contains non-ASCII characters, as
-    #    you can't put the file encoding declaration before the shebang line.
-    # The solution is to use Python's -x flag to skip the first line of the
-    # script (and any ASCII decoding errors that may have occurred in that line)
-    cmd = [py_executable, '-x', join(os.path.dirname(py_executable), easy_install_script), filename]
-    # jython and pypy don't yet support -x
-    if is_jython or is_pypy:
-        cmd.remove('-x')
-    if filename == 'pip':
-        if never_download:
-            logger.fatal("Can't find any local distributions of pip to install "
-                         "and --never-download is set.  Either re-run virtualenv "
-                         "without the --never-download option, or place a pip "
-                         "source distribution (zip/tar.gz/tar.bz2) in one of these "
-                         "locations: %r" % search_dirs)
-            sys.exit(1)
-        logger.info('Installing pip from network...')
-    else:
-        logger.info('Installing existing %s distribution: %s' % (
-                os.path.basename(filename), filename))
-    logger.start_progress('Installing pip...')
-    logger.indent += 2
-    def _filter_setup(line):
-        return filter_ez_setup(line, 'pip')
-    try:
-        call_subprocess(cmd, show_stdout=False,
-                        filter_stdout=_filter_setup)
-    finally:
-        logger.indent -= 2
-        logger.end_progress()
-
-def filter_ez_setup(line, project_name='setuptools'):
-    if not line.strip():
-        return Logger.DEBUG
-    if project_name == 'distribute':
-        for prefix in ('Extracting', 'Now working', 'Installing', 'Before',
-                       'Scanning', 'Setuptools', 'Egg', 'Already',
-                       'running', 'writing', 'reading', 'installing',
-                       'creating', 'copying', 'byte-compiling', 'removing',
-                       'Processing'):
-            if line.startswith(prefix):
-                return Logger.DEBUG
-        return Logger.DEBUG
-    for prefix in ['Reading ', 'Best match', 'Processing setuptools',
-                   'Copying setuptools', 'Adding setuptools',
-                   'Installing ', 'Installed ']:
-        if line.startswith(prefix):
-            return Logger.DEBUG
-    return Logger.INFO
-
 
 class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter):
     """
     Custom help formatter for use in ConfigOptionParser that updates
     the defaults before expanding them, allowing them to show up correctly
     in the help listing
     """
     def expand_default(self, option):
         if self.parser is not None:
             self.parser.update_defaults(self.parser.defaults)
         return optparse.IndentedHelpFormatter.expand_default(self, option)
 
 
 class ConfigOptionParser(optparse.OptionParser):
     """
-    Custom option parser which updates its defaults by by checking the
+    Custom option parser which updates its defaults by checking the
     configuration files and environmental variables
     """
     def __init__(self, *args, **kwargs):
         self.config = ConfigParser.RawConfigParser()
         self.files = self.get_config_files()
         self.config.read(self.files)
         optparse.OptionParser.__init__(self, *args, **kwargs)
 
@@ -837,66 +680,84 @@ def main():
     parser.add_option(
         '--system-site-packages',
         dest='system_site_packages',
         action='store_true',
         help="Give access to the global site-packages dir to the "
              "virtual environment")
 
     parser.add_option(
+        '--always-copy',
+        dest='symlink',
+        action='store_false',
+        default=True,
+        help="Always copy files rather than symlinking")
+
+    parser.add_option(
         '--unzip-setuptools',
         dest='unzip_setuptools',
         action='store_true',
-        help="Unzip Setuptools or Distribute when installing it")
+        help="Unzip Setuptools when installing it")
 
     parser.add_option(
         '--relocatable',
         dest='relocatable',
         action='store_true',
         help='Make an EXISTING virtualenv environment relocatable.  '
         'This fixes up scripts and makes all .pth files relative')
 
     parser.add_option(
-        '--distribute', '--use-distribute',  # the second option is for legacy reasons here. Hi Kenneth!
-        dest='use_distribute',
+        '--no-setuptools',
+        dest='no_setuptools',
         action='store_true',
-        help='Use Distribute instead of Setuptools. Set environ variable '
-        'VIRTUALENV_DISTRIBUTE to make it the default ')
+        help='Do not install setuptools (or pip) '
+        'in the new virtualenv.')
 
     parser.add_option(
-        '--setuptools',
-        dest='use_distribute',
-        action='store_false',
-        help='Use Setuptools instead of Distribute.  Set environ variable '
-        'VIRTUALENV_SETUPTOOLS to make it the default ')
-
-    # Set this to True to use distribute by default, even in Python 2.
-    parser.set_defaults(use_distribute=False)
+        '--no-pip',
+        dest='no_pip',
+        action='store_true',
+        help='Do not install pip in the new virtualenv.')
 
     default_search_dirs = file_search_dirs()
     parser.add_option(
         '--extra-search-dir',
         dest="search_dirs",
         action="append",
         default=default_search_dirs,
-        help="Directory to look for setuptools/distribute/pip distributions in. "
+        help="Directory to look for setuptools/pip distributions in. "
         "You can add any number of additional --extra-search-dir paths.")
 
     parser.add_option(
         '--never-download',
         dest="never_download",
         action="store_true",
-        help="Never download anything from the network.  Instead, virtualenv will fail "
-        "if local distributions of setuptools/distribute/pip are not present.")
+        default=True,
+        help="Never download anything from the network. This is now always "
+        "the case. The option is only retained for backward compatibility, "
+        "and does nothing. Virtualenv will fail if local distributions "
+        "of setuptools/pip are not present.")
 
     parser.add_option(
         '--prompt',
         dest='prompt',
         help='Provides an alternative prompt prefix for this environment')
 
+    parser.add_option(
+        '--setuptools',
+        dest='setuptools',
+        action='store_true',
+        help="Backward compatibility. Does nothing.")
+
+    parser.add_option(
+        '--distribute',
+        dest='distribute',
+        action='store_true',
+        help="Backward compatibility. Does nothing.")
+
     if 'extend_parser' in globals():
         extend_parser(parser)
 
     options, args = parser.parse_args()
 
     global logger
 
     if 'adjust_options' in globals():
@@ -914,26 +775,16 @@ def main():
             logger.notify('Running virtualenv with interpreter %s' % interpreter)
             env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true'
             file = __file__
             if file.endswith('.pyc'):
                 file = file[:-1]
             popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
             raise SystemExit(popen.wait())
 
-    # Force --distribute on Python 3, since setuptools is not available.
-    if majver > 2:
-        options.use_distribute = True
-
-    if os.environ.get('PYTHONDONTWRITEBYTECODE') and not options.use_distribute:
-        print(
-            "The PYTHONDONTWRITEBYTECODE environment variable is "
-            "not compatible with setuptools. Either use --distribute "
-            "or unset PYTHONDONTWRITEBYTECODE.")
-        sys.exit(2)
     if not args:
         print('You must provide a DEST_DIR')
         parser.print_help()
         sys.exit(2)
     if len(args) > 1:
         print('There must be only one argument: DEST_DIR (you gave %s)' % (
             ' '.join(args)))
         parser.print_help()
@@ -949,24 +800,30 @@ def main():
     if 'PYTHONHOME' in os.environ:
         logger.warn('PYTHONHOME is set.  You *must* activate the virtualenv before using it')
         del os.environ['PYTHONHOME']
 
     if options.relocatable:
         make_environment_relocatable(home_dir)
         return
 
+    if not options.never_download:
+        logger.warn('The --never-download option is for backward compatibility only.')
+        logger.warn('Setting it to false is no longer supported, and will be ignored.')
+
     create_environment(home_dir,
                        site_packages=options.system_site_packages,
                        clear=options.clear,
                        unzip_setuptools=options.unzip_setuptools,
-                       use_distribute=options.use_distribute,
                        prompt=options.prompt,
                        search_dirs=options.search_dirs,
-                       never_download=options.never_download)
+                       never_download=True,
+                       no_setuptools=options.no_setuptools,
+                       no_pip=options.no_pip,
+                       symlink=options.symlink)
     if 'after_install' in globals():
         after_install(options, home_dir)
 
 def call_subprocess(cmd, show_stdout=True,
                     filter_stdout=None, cwd=None,
                     raise_on_returncode=True, extra_env=None,
                     remove_from_env=None):
     cmd_parts = []
@@ -1040,45 +897,75 @@ def call_subprocess(cmd, show_stdout=Tru
             raise OSError(
                 "Command %s failed with error code %s"
                 % (cmd_desc, proc.returncode))
         else:
             logger.warn(
                 "Command %s had error code %s"
                 % (cmd_desc, proc.returncode))
 
+def filter_install_output(line):
+    if line.strip().startswith('running'):
+        return Logger.INFO
+    return Logger.DEBUG
+
+def install_sdist(project_name, sdist, py_executable, search_dirs=None):
+
+    if search_dirs is None:
+        search_dirs = file_search_dirs()
+    found, sdist_path = _find_file(sdist, search_dirs)
+    if not found:
+        logger.fatal("Cannot find sdist %s" % (sdist,))
+        return
+
+    tmpdir = tempfile.mkdtemp()
+    try:
+        tar = tarfile.open(sdist_path)
+        tar.extractall(tmpdir)
+        tar.close()
+        srcdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
+        cmd = [py_executable, 'setup.py', 'install',
+            '--single-version-externally-managed',
+            '--record', 'record']
+        logger.start_progress('Installing %s...' % project_name)
+        logger.indent += 2
+        try:
+            call_subprocess(cmd, show_stdout=False, cwd=srcdir,
+                    filter_stdout=filter_install_output)
+        finally:
+            logger.indent -= 2
+            logger.end_progress()
+    finally:
+        shutil.rmtree(tmpdir)
 
 def create_environment(home_dir, site_packages=False, clear=False,
-                       unzip_setuptools=False, use_distribute=False,
-                       prompt=None, search_dirs=None, never_download=False):
+                       unzip_setuptools=False,
+                       prompt=None, search_dirs=None, never_download=False,
+                       no_setuptools=False, no_pip=False, symlink=True):
     """
     Creates a new environment in ``home_dir``.
 
     If ``site_packages`` is true, then the global ``site-packages/``
     directory will be on the path.
 
     If ``clear`` is true (default False) then the environment will
     first be cleared.
     """
     home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
 
     py_executable = os.path.abspath(install_python(
         home_dir, lib_dir, inc_dir, bin_dir,
-        site_packages=site_packages, clear=clear))
+        site_packages=site_packages, clear=clear, symlink=symlink))
 
     install_distutils(home_dir)
 
-    if use_distribute:
-        install_distribute(py_executable, unzip=unzip_setuptools,
-                           search_dirs=search_dirs, never_download=never_download)
-    else:
-        install_setuptools(py_executable, unzip=unzip_setuptools,
-                           search_dirs=search_dirs, never_download=never_download)
-
-    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
+    if not no_setuptools:
+        install_sdist('Setuptools', 'setuptools-*.tar.gz', py_executable, search_dirs)
+        if not no_pip:
+            install_sdist('Pip', 'pip-*.tar.gz', py_executable, search_dirs)
 
     install_activate(home_dir, bin_dir, prompt)
 
 def is_executable_file(fpath):
     return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
 
 def path_locations(home_dir):
     """Return the path locations for the environment (where libraries are,
@@ -1161,17 +1048,17 @@ def change_prefix(filename, dst_prefix):
             _, relpath = filename.split(src_prefix, 1)
             if src_prefix != os.sep: # sys.prefix == "/"
                 assert relpath[0] == os.sep
                 relpath = relpath[1:]
             return join(dst_prefix, relpath)
     assert False, "Filename %s does not start with any of these prefixes: %s" % \
         (filename, prefixes)
 
-def copy_required_modules(dst_prefix):
+def copy_required_modules(dst_prefix, symlink):
     import imp
     # If we are running under -p, we need to remove the current
     # directory from sys.path temporarily here, so that we
     # definitely get the modules from the site directory of
     # the interpreter we are running under, not the one
     # virtualenv.py is installed under (which might lead to py2/py3
     # incompatibility issues)
     _prev_sys_path = sys.path
@@ -1184,41 +1071,47 @@ def copy_required_modules(dst_prefix):
                 continue
             try:
                 f, filename, _ = imp.find_module(modname)
             except ImportError:
                 logger.info("Cannot import bootstrap module: %s" % modname)
             else:
                 if f is not None:
                     f.close()
-                # special-case custom readline.so on OS X:
-                if modname == 'readline' and sys.platform == 'darwin' and not filename.endswith(join('lib-dynload', 'readline.so')):
+                # special-case custom readline.so on OS X, but not for pypy:
+                if modname == 'readline' and sys.platform == 'darwin' and not (
+                        is_pypy or filename.endswith(join('lib-dynload', 'readline.so'))):
                     dst_filename = join(dst_prefix, 'lib', 'python%s' % sys.version[:3], 'readline.so')
+                elif modname == 'readline' and sys.platform == 'win32':
+                    # special-case for Windows, where readline is not a
+                    # standard module, though it may have been installed in
+                    # site-packages by a third-party package
+                    pass
                 else:
                     dst_filename = change_prefix(filename, dst_prefix)
-                copyfile(filename, dst_filename)
+                copyfile(filename, dst_filename, symlink)
                 if filename.endswith('.pyc'):
                     pyfile = filename[:-1]
                     if os.path.exists(pyfile):
-                        copyfile(pyfile, dst_filename[:-1])
+                        copyfile(pyfile, dst_filename[:-1], symlink)
     finally:
         sys.path = _prev_sys_path
 
 
 def subst_path(prefix_path, prefix, home_dir):
     prefix_path = os.path.normpath(prefix_path)
     prefix = os.path.normpath(prefix)
     home_dir = os.path.normpath(home_dir)
     if not prefix_path.startswith(prefix):
         logger.warn('Path not in prefix %r %r', prefix_path, prefix)
         return
     return prefix_path.replace(prefix, home_dir, 1)
 
 
-def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
+def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, symlink=True):
     """Install just the base environment, no distutils patches etc"""
     if sys.executable.startswith(bin_dir):
         print('Please use the *system* python to run this script')
         return
 
     if clear:
         rmtree(lib_dir)
         ## FIXME: why not delete it?
@@ -1229,17 +1122,17 @@ def install_python(home_dir, lib_dir, in
         logger.notify('Using real prefix %r' % sys.real_prefix)
         prefix = sys.real_prefix
     elif hasattr(sys, 'base_prefix'):
         logger.notify('Using base prefix %r' % sys.base_prefix)
         prefix = sys.base_prefix
     else:
         prefix = sys.prefix
     mkdir(lib_dir)
-    fix_lib64(lib_dir)
+    fix_lib64(lib_dir, symlink)
     stdlib_dirs = [os.path.dirname(os.__file__)]
     if is_win:
         stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
     elif is_darwin:
         stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages'))
     if hasattr(os, 'symlink'):
         logger.info('Symlinking Python bootstrap modules')
     else:
@@ -1248,19 +1141,19 @@ def install_python(home_dir, lib_dir, in
     try:
         # copy required files...
         for stdlib_dir in stdlib_dirs:
             if not os.path.isdir(stdlib_dir):
                 continue
             for fn in os.listdir(stdlib_dir):
                 bn = os.path.splitext(fn)[0]
                 if fn != 'site-packages' and bn in REQUIRED_FILES:
-                    copyfile(join(stdlib_dir, fn), join(lib_dir, fn))
+                    copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
         # ...and modules
-        copy_required_modules(home_dir)
+        copy_required_modules(home_dir, symlink)
     finally:
         logger.indent -= 2
     mkdir(join(lib_dir, 'site-packages'))
     import site
     site_filename = site.__file__
     if site_filename.endswith('.pyc'):
         site_filename = site_filename[:-1]
     elif site_filename.endswith('$py.class'):
@@ -1273,53 +1166,53 @@ def install_python(home_dir, lib_dir, in
     if not site_packages:
         writefile(site_packages_filename, '')
 
     if is_pypy or is_win:
         stdinc_dir = join(prefix, 'include')
     else:
         stdinc_dir = join(prefix, 'include', py_version + abiflags)
     if os.path.exists(stdinc_dir):
-        copyfile(stdinc_dir, inc_dir)
+        copyfile(stdinc_dir, inc_dir, symlink)
     else:
         logger.debug('No include dir %s' % stdinc_dir)
 
     platinc_dir = distutils.sysconfig.get_python_inc(plat_specific=1)
     if platinc_dir != stdinc_dir:
         platinc_dest = distutils.sysconfig.get_python_inc(
             plat_specific=1, prefix=home_dir)
         if platinc_dir == platinc_dest:
             # Do platinc_dest manually due to a CPython bug;
             # not http://bugs.python.org/issue3386 but a close cousin
             platinc_dest = subst_path(platinc_dir, prefix, home_dir)
         if platinc_dest:
             # PyPy's stdinc_dir and prefix are relative to the original binary
             # (traversing virtualenvs), whereas the platinc_dir is relative to
             # the inner virtualenv and ignores the prefix argument.
             # This seems more evolved than designed.
-            copyfile(platinc_dir, platinc_dest)
+            copyfile(platinc_dir, platinc_dest, symlink)
 
     # pypy never uses exec_prefix, just ignore it
     if sys.exec_prefix != prefix and not is_pypy:
         if is_win:
             exec_dir = join(sys.exec_prefix, 'lib')
         elif is_jython:
             exec_dir = join(sys.exec_prefix, 'Lib')
         else:
             exec_dir = join(sys.exec_prefix, 'lib', py_version)
         for fn in os.listdir(exec_dir):
-            copyfile(join(exec_dir, fn), join(lib_dir, fn))
+            copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink)
 
     if is_jython:
         # Jython has either jython-dev.jar and javalib/ dir, or just
         # jython.jar
         for name in 'jython-dev.jar', 'javalib', 'jython.jar':
             src = join(prefix, name)
             if os.path.exists(src):
-                copyfile(src, join(home_dir, name))
+                copyfile(src, join(home_dir, name), symlink)
         # XXX: registry should always exist after Jython 2.5rc1
         src = join(prefix, 'registry')
         if os.path.exists(src):
             copyfile(src, join(home_dir, 'registry'), symlink=False)
         copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'),
                  symlink=False)
 
     mkdir(bin_dir)
@@ -1346,21 +1239,16 @@ def install_python(home_dir, lib_dir, in
         pcbuild_dir = None
         if os.path.exists(pyd_pth):
             logger.info('Deleting %s (not Windows env or not build directory python)' % pyd_pth)
             os.unlink(pyd_pth)
 
     if sys.executable != py_executable:
         ## FIXME: could I just hard link?
         executable = sys.executable
-        if is_cygwin and os.path.exists(executable + '.exe'):
-            # Cygwin misreports sys.executable sometimes
-            executable += '.exe'
-            py_executable += '.exe'
-            logger.info('Executable actually exists in %s' % executable)
         shutil.copyfile(executable, py_executable)
         make_exe(py_executable)
         if is_win or is_cygwin:
             pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe')
             if os.path.exists(pythonw):
                 logger.info('Also created pythonw.exe')
                 shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe'))
             python_d = os.path.join(os.path.dirname(sys.executable), 'python_d.exe')
@@ -1390,29 +1278,29 @@ def install_python(home_dir, lib_dir, in
                 logger.info('Removed %s as the source does not exist' % pythondll_d_dest)
                 os.unlink(pythondll_d_dest)
         if is_pypy:
             # make a symlink python --> pypy-c
             python_executable = os.path.join(os.path.dirname(py_executable), 'python')
             if sys.platform in ('win32', 'cygwin'):
                 python_executable += '.exe'
             logger.info('Also created executable %s' % python_executable)
-            copyfile(py_executable, python_executable)
+            copyfile(py_executable, python_executable, symlink)
 
             if is_win:
                 for name in 'libexpat.dll', 'libpypy.dll', 'libpypy-c.dll', 'libeay32.dll', 'ssleay32.dll', 'sqlite.dll':
                     src = join(prefix, name)
                     if os.path.exists(src):
-                        copyfile(src, join(bin_dir, name))
+                        copyfile(src, join(bin_dir, name), symlink)
 
     if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe:
         secondary_exe = os.path.join(os.path.dirname(py_executable),
                                      expected_exe)
         py_executable_ext = os.path.splitext(py_executable)[1]
-        if py_executable_ext == '.exe':
+        if py_executable_ext.lower() == '.exe':
             # python2.4 gives an extension of '.4' :P
             secondary_exe += py_executable_ext
         if os.path.exists(secondary_exe):
             logger.warn('Not overwriting existing %s script %s (you must use %s)'
                         % (expected_exe, secondary_exe, py_executable))
         else:
             logger.notify('Also creating executable in %s' % secondary_exe)
             shutil.copyfile(sys.executable, secondary_exe)
@@ -1436,17 +1324,18 @@ def install_python(home_dir, lib_dir, in
         # Copy the framework's dylib into the virtual
         # environment
         virtual_lib = os.path.join(home_dir, '.Python')
 
         if os.path.exists(virtual_lib):
             os.unlink(virtual_lib)
         copyfile(
             os.path.join(prefix, 'Python'),
-            virtual_lib)
+            virtual_lib,
+            symlink)
 
         # And then change the install_name of the copied python executable
         try:
             mach_o_change(py_executable,
                           os.path.join(prefix, 'Python'),
                           '@executable_path/../.Python')
         except:
             e = sys.exc_info()[1]
@@ -1477,17 +1366,20 @@ def install_python(home_dir, lib_dir, in
         if py_executable_base in required_symlinks:
             # Don't try to symlink to yourself.
             required_symlinks.remove(py_executable_base)
 
         for pth in required_symlinks:
             full_pth = join(bin_dir, pth)
             if os.path.exists(full_pth):
                 os.unlink(full_pth)
-            os.symlink(py_executable_base, full_pth)
+            if symlink:
+                os.symlink(py_executable_base, full_pth)
+            else:
+                shutil.copyfile(py_executable_base, full_pth)
 
     if is_win and ' ' in py_executable:
         # There's a bug with subprocess on Windows when using a first
         # argument that has a space in it.  Instead we have to quote
         # the value:
         py_executable = '"%s"' % py_executable
     # NOTE: keep this check as one line, cmd.exe doesn't cope with line breaks
     cmd = [py_executable, '-c', 'import sys;out=sys.stdout;'
@@ -1530,17 +1422,17 @@ def install_python(home_dir, lib_dir, in
         logger.info('Got sys.prefix result: %r' % proc_stdout)
 
     pydistutils = os.path.expanduser('~/.pydistutils.cfg')
     if os.path.exists(pydistutils):
         logger.notify('Please make sure you remove any previous custom paths from '
                       'your %s file.' % pydistutils)
     ## FIXME: really this should be calculated earlier
 
-    fix_local_scheme(home_dir)
+    fix_local_scheme(home_dir, symlink)
 
     if site_packages:
         if os.path.exists(site_packages_filename):
             logger.info('Deleting %s' % site_packages_filename)
             os.unlink(site_packages_filename)
 
     return py_executable
 
@@ -1591,61 +1483,76 @@ def install_distutils(home_dir):
     ## FIXME: maybe this prefix setting should only be put in place if
     ## there's a local distutils.cfg with a prefix setting?
     home_dir = os.path.abspath(home_dir)
     ## FIXME: this is breaking things, removing for now:
     #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % home_dir
     writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT)
     writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False)
 
-def fix_local_scheme(home_dir):
+def fix_local_scheme(home_dir, symlink=True):
     """
     Platforms that use the "posix_local" install scheme (like Ubuntu with
     Python 2.7) need to be given an additional "local" location, sigh.
     """
     try:
         import sysconfig
     except ImportError:
         pass
     else:
         if sysconfig._get_default_scheme() == 'posix_local':
             local_path = os.path.join(home_dir, 'local')
             if not os.path.exists(local_path):
                 os.mkdir(local_path)
                 for subdir_name in os.listdir(home_dir):
                     if subdir_name == 'local':
                         continue
-                    os.symlink(os.path.abspath(os.path.join(home_dir, subdir_name)), \
+                    cp_or_ln = (os.symlink if symlink else copyfile)
+                    cp_or_ln(os.path.abspath(os.path.join(home_dir, subdir_name)), \
                                                             os.path.join(local_path, subdir_name))
 
-def fix_lib64(lib_dir):
+def fix_lib64(lib_dir, symlink=True):
     """
     Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y
     instead of lib/pythonX.Y.  If this is such a platform we'll just create a
     symlink so lib64 points to lib
     """
     if [p for p in distutils.sysconfig.get_config_vars().values()
         if isinstance(p, basestring) and 'lib64' in p]:
+        # PyPy's library path scheme is not affected by this.
+        # Return early or we will die on the following assert.
+        if is_pypy:
+            logger.debug('PyPy detected, skipping lib64 symlinking')
+            return
+
         logger.debug('This system uses lib64; symlinking lib64 to lib')
+
         assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
             "Unexpected python lib dir: %r" % lib_dir)
         lib_parent = os.path.dirname(lib_dir)
         top_level = os.path.dirname(lib_parent)
         lib_dir = os.path.join(top_level, 'lib')
         lib64_link = os.path.join(top_level, 'lib64')
         assert os.path.basename(lib_parent) == 'lib', (
             "Unexpected parent dir: %r" % lib_parent)
         if os.path.lexists(lib64_link):
             return
-        os.symlink('lib', lib64_link)
+        cp_or_ln = (os.symlink if symlink else copyfile)
+        cp_or_ln('lib', lib64_link)
 
 def resolve_interpreter(exe):
     """
     If the executable given isn't an absolute path, search $PATH for the interpreter
     """
+    # If the "executable" is a version number, get the installed executable for
+    # that version
+    python_versions = get_installed_pythons()
+    if exe in python_versions:
+        exe = python_versions[exe]
+
     if os.path.abspath(exe) != exe:
         paths = os.environ.get('PATH', '').split(os.pathsep)
         for path in paths:
             if os.path.exists(os.path.join(path, exe)):
                 exe = os.path.join(path, exe)
                 break
     if not os.path.exists(exe):
         logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe))
@@ -1668,34 +1575,37 @@ def make_environment_relocatable(home_di
     the #!-based environment selection in scripts.
     """
     home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
     activate_this = os.path.join(bin_dir, 'activate_this.py')
     if not os.path.exists(activate_this):
         logger.fatal(
             'The environment doesn\'t have a file %s -- please re-run virtualenv '
             'on this environment to update it' % activate_this)
-    fixup_scripts(home_dir)
+    fixup_scripts(home_dir, bin_dir)
     fixup_pth_and_egg_link(home_dir)
     ## FIXME: need to fix up distutils.cfg
 
 OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3],
                   'activate', 'activate.bat', 'activate_this.py']
 
-def fixup_scripts(home_dir):
-    # This is what we expect at the top of scripts:
-    shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir))
-    # This is what we'll put:
-    new_shebang = '#!/usr/bin/env python%s' % sys.version[:3]
+def fixup_scripts(home_dir, bin_dir):
     if is_win:
-        bin_suffix = 'Scripts'
+        new_shebang_args = (
+            '%s /c' % os.path.normcase(os.environ.get('COMSPEC', 'cmd.exe')),
+            '', '.exe')
     else:
-        bin_suffix = 'bin'
-    bin_dir = os.path.join(home_dir, bin_suffix)
-    home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
+        new_shebang_args = ('/usr/bin/env', sys.version[:3], '')
+
+    # This is what we expect at the top of scripts:
+    shebang = '#!%s' % os.path.normcase(os.path.join(
+        os.path.abspath(bin_dir), 'python%s' % new_shebang_args[2]))
+    # This is what we'll put:
+    new_shebang = '#!%s python%s%s' % new_shebang_args
+
     for filename in os.listdir(bin_dir):
         filename = os.path.join(bin_dir, filename)
         if not os.path.isfile(filename):
             # ignore subdirs, e.g. .svn ones.
             continue
         f = open(filename, 'rb')
         try:
             try:
@@ -1704,34 +1614,38 @@ def fixup_scripts(home_dir):
                 # This is probably a binary program instead
                 # of a script, so just ignore it.
                 continue
         finally:
             f.close()
         if not lines:
             logger.warn('Script %s is an empty file' % filename)
             continue
-        if not lines[0].strip().startswith(shebang):
+
+        old_shebang = lines[0].strip()
+        old_shebang = old_shebang[0:2] + os.path.normcase(old_shebang[2:])
+
+        if not old_shebang.startswith(shebang):
             if os.path.basename(filename) in OK_ABS_SCRIPTS:
                 logger.debug('Cannot make script %s relative' % filename)
             elif lines[0].strip() == new_shebang:
                 logger.info('Script %s has already been made relative' % filename)
             else:
                 logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)'
                             % (filename, shebang))
             continue
         logger.notify('Making script %s relative' % filename)
         script = relative_script([new_shebang] + lines[1:])
         f = open(filename, 'wb')
         f.write('\n'.join(script).encode('utf-8'))
         f.close()
 
 def relative_script(lines):
     "Return a script that'll work in a relocatable environment."
-    activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this"
+    activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this"
     # Find the last future statement in the script. If we insert the activation
     # line before a future statement, Python will raise a SyntaxError.
     activate_at = None
     for idx, line in reversed(list(enumerate(lines))):
         if line.split()[:3] == ['from', '__future__', 'import']:
             activate_at = idx + 1
             break
     if activate_at is None:
@@ -1896,326 +1810,157 @@ def create_bootstrap_script(extra_text, 
 ##EXTEND##
 
 def convert(s):
     b = base64.b64decode(s.encode('ascii'))
     return zlib.decompress(b).decode('utf-8')
 
 ##file site.py
 SITE_PY = convert("""
-eJzFPf1z2zaWv/OvwMqToeTKdOJ0eztO3RsncVrfuYm3SWdz63q0lARZrCmSJUjL6s3d337vAwAB
-kpLtTXdO04klEnh4eHhfeHgPHQwGp0Uhs7lY5fM6lULJuJwtRRFXSyUWeSmqZVLOD4q4rDbwdHYb
-30glqlyojYqwVRQE+1/4CfbFp2WiDArwLa6rfBVXySxO041IVkVeVnIu5nWZZDciyZIqidPkd2iR
-Z5HY/3IMgvNMwMzTRJbiTpYK4CqRL8TlplrmmRjWBc75RfTn+OVoLNSsTIoKGpQaZ6DIMq6CTMo5
-oAktawWkTCp5oAo5SxbJzDZc53U6F0Uaz6T4xz94atQ0DAOVr+R6KUspMkAGYEqAVSAe8DUpxSyf
-y0iI13IW4wD8vCFWwNDGuGYKyZjlIs2zG5hTJmdSqbjciOG0rggQ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an8q5Nt7vhGK7BtlYIfFilqj8cx3SkqCdPR6ja5S8CoFNfa37BZbCldqAO
-8/kPV23RfN0yyhwk+KALUaFOdBGEaJIuAT1/Qt5i+T3aqXn7hRvzeB4OlPP6qzTX3zYxV4vmpPLY
-1ad2hCkv9PyTfmqoFKGnJK1e1ke/EPmgJsWzYuR+FBfN/KN6rfaouBN7AUT33JfuWv2pViwvXbUW
-0tZCXTQXBV1cnnUnx+rdu+bUWbZF9cmTZ9kVu3oErEv0u7n646bY4N8aXIHxoek064as3chE8T2U
-y9Vd97JZwuKudB7VUDGf15NCXaT7wMADGCGrdmLQXxHatnfNB1HVSavuL/uT9E53DLtdE/UdJI2M
-taFhedW0RC0Ar8bGHkiFaXALPc1SkILtl/P3Wf8rPu+z5bt//Xb3YvXbXLcnq/4Yo9/ucdETjI1C
-rr9klRpCscBn8+skbRmxVhX/f7fRgk3dei/t1R3GMA3kC/20fojRFY82d0+bv3hsYkI27VGneg+A
-GcxocdxuF7udStjdbtF9sJEqiVBT5/BrR5fD9u939h3eefkSYNWp0itfvdzpljubu6fqouaIi0y1
-qL7+C1AkCcw=
-""")
-
-##file distribute_from_egg.py
-DISTRIBUTE_FROM_EGG_PY = convert("""
-eJw9j8tqAzEMRfcG/4MgmxQyptkGusonZBmGoGTUGYFfWPKE6dfXTkM3gqt7rh47OKP3NMF3SQFW
-LlrRU1zhybpAxoKBlIqcrNnBdRjQP3GTocYfzmNrrCPQPN9iwzpxSQfQhWBi0cL3qtRtYIG/4Mv0
-KApY5hooqrOGQ05FQTaxptF9Fnx16Rq0XofjaE1XGXVxHIWK7j8P8EY/rHndLqQ1a0pe3COFgHFy
-hLLdWkDbi/DeEpCjNb3u/zccT2Ob8gtnwVyI
-""")
-
-##file distribute_setup.py
-DISTRIBUTE_SETUP_PY = convert("""
-eJztPF1z2ziS7/oVOLlcpHISE2fm5q5cp6nKTDyzrs0mqTjZfUhcMkRCEsf8GpC0ov31190ACICk
-ZOdm9uGqzrtjS0Sj0ej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DgqBcwOgTMx+gDQQqXCw==
 """)
 
 ##file deactivate.bat
 DEACTIVATE_BAT = convert("""
-eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgUliIit
-KhZlqkpcnCA1WKRsuTTxWBIZ4uHv5+Hv64piEVwU3TK4BNBCmHIcKvDb6xjigWIjkI9uF1AIu7dA
-akGGW7n6uXABALCXXUI=
+eJxzSE3OyFfIT0vj4ipOLVEI8wwKCXX0iXf1C7Pl4spMU0hJTcvMS01RiPf3cYmHyQYE+fsGhCho
+cCkAAUibEkTEVhWLMlUlLk6QGixStlyaeCyJDPHw9/Pw93VFsQguim4ZXAJoIUw5DhX47XUM8UCx
+EchHtwsohN1bILUgw61c/Vy4AJYPYm4=
 """)
 
 ##file activate.ps1
 ACTIVATE_PS = convert("""
 eJylWdmS40Z2fVeE/oHT6rCloNUEAXDThB6wAyQAEjsB29GBjdgXYiWgmC/zgz/Jv+AEWNVd3S2N
 xuOKYEUxM+/Jmzfvcm7W//zXf/+wUMOoXtyi1F9kbd0sHH/hFc2iLtrK9b3FrSqyxaVQwr8uhqJd
 uHaeg9mqzRdR8/13Pyy8qPLdJh0+LMhi0QCoXxYfFh9WtttEnd34H8p6/f1300KauwrULws39e18
 0ZaLNm9rgN/ZVf3h++/e124Vlc0vKsspHy+Yyi5+XbzPhijvCtduoiL/kA1ukWV27n0o7Sb8LIFj
--- a/python/virtualenv/virtualenv_embedded/deactivate.bat
+++ b/python/virtualenv/virtualenv_embedded/deactivate.bat
@@ -1,10 +1,12 @@
 @echo off
 
+set VIRTUAL_ENV=
+
 if defined _OLD_VIRTUAL_PROMPT (
     set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
 	set _OLD_VIRTUAL_PROMPT=
 )
 
 if defined _OLD_VIRTUAL_PYTHONHOME (
     set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
     set _OLD_VIRTUAL_PYTHONHOME=
deleted file mode 100644
--- a/python/virtualenv/virtualenv_embedded/distribute_from_egg.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Called from virtualenv with parameters:
-# [--always-unzip] [-v] egg_name
-# So, the distribute egg is always the last argument.
-import sys
-eggname = sys.argv[-1]
-sys.path.insert(0, eggname)
-from setuptools.command.easy_install import main
-main(sys.argv[1:])
deleted file mode 100644
--- a/python/virtualenv/virtualenv_embedded/distribute_setup.py
+++ /dev/null
@@ -1,541 +0,0 @@
-#!python
-"""Bootstrap distribute installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
-    from distribute_setup import use_setuptools
-    use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import os
-import shutil
-import sys
-import time
-import fnmatch
-import tempfile
-import tarfile
-import optparse
-
-from distutils import log
-
-try:
-    from site import USER_SITE
-except ImportError:
-    USER_SITE = None
-
-try:
-    import subprocess
-
-    def _python_cmd(*args):
-        args = (sys.executable,) + args
-        return subprocess.call(args) == 0
-
-except ImportError:
-    # will be used for python 2.3
-    def _python_cmd(*args):
-        args = (sys.executable,) + args
-        # quoting arguments if windows
-        if sys.platform == 'win32':
-            def quote(arg):
-                if ' ' in arg:
-                    return '"%s"' % arg
-                return arg
-            args = [quote(arg) for arg in args]
-        return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
-
-DEFAULT_VERSION = "0.6.31"
-DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
-SETUPTOOLS_FAKED_VERSION = "0.6c11"
-
-SETUPTOOLS_PKG_INFO = """\
-Metadata-Version: 1.0
-Name: setuptools
-Version: %s
-Summary: xxxx
-Home-page: xxx
-Author: xxx
-Author-email: xxx
-License: xxx
-Description: xxx
-""" % SETUPTOOLS_FAKED_VERSION
-
-
-def _install(tarball, install_args=()):
-    # extracting the tarball
-    tmpdir = tempfile.mkdtemp()
-    log.warn('Extracting in %s', tmpdir)
-    old_wd = os.getcwd()
-    try:
-        os.chdir(tmpdir)
-        tar = tarfile.open(tarball)
-        _extractall(tar)
-        tar.close()
-
-        # going in the directory
-        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
-        os.chdir(subdir)
-        log.warn('Now working in %s', subdir)
-
-        # installing
-        log.warn('Installing Distribute')
-        if not _python_cmd('setup.py', 'install', *install_args):
-            log.warn('Something went wrong during the installation.')
-            log.warn('See the error message above.')
-            # exitcode will be 2
-            return 2
-    finally:
-        os.chdir(old_wd)
-        shutil.rmtree(tmpdir)
-
-
-def _build_egg(egg, tarball, to_dir):
-    # extracting the tarball
-    tmpdir = tempfile.mkdtemp()
-    log.warn('Extracting in %s', tmpdir)
-    old_wd = os.getcwd()
-    try:
-        os.chdir(tmpdir)
-        tar = tarfile.open(tarball)
-        _extractall(tar)
-        tar.close()
-
-        # going in the directory
-        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
-        os.chdir(subdir)
-        log.warn('Now working in %s', subdir)
-
-        # building an egg
-        log.warn('Building a Distribute egg in %s', to_dir)
-        _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
-
-    finally:
-        os.chdir(old_wd)
-        shutil.rmtree(tmpdir)
-    # returning the result
-    log.warn(egg)
-    if not os.path.exists(egg):
-        raise IOError('Could not build the egg.')
-
-
-def _do_download(version, download_base, to_dir, download_delay):
-    egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
-                       % (version, sys.version_info[0], sys.version_info[1]))
-    if not os.path.exists(egg):
-        tarball = download_setuptools(version, download_base,
-                                      to_dir, download_delay)
-        _build_egg(egg, tarball, to_dir)
-    sys.path.insert(0, egg)
-    import setuptools
-    setuptools.bootstrap_install_from = egg
-
-
-def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
-                   to_dir=os.curdir, download_delay=15, no_fake=True):
-    # making sure we use the absolute path
-    to_dir = os.path.abspath(to_dir)
-    was_imported = 'pkg_resources' in sys.modules or \
-        'setuptools' in sys.modules
-    try:
-        try:
-            import pkg_resources
-            if not hasattr(pkg_resources, '_distribute'):
-                if not no_fake:
-                    _fake_setuptools()
-                raise ImportError
-        except ImportError:
-            return _do_download(version, download_base, to_dir, download_delay)
-        try:
-            pkg_resources.require("distribute>=" + version)
-            return
-        except pkg_resources.VersionConflict:
-            e = sys.exc_info()[1]
-            if was_imported:
-                sys.stderr.write(
-                "The required version of distribute (>=%s) is not available,\n"
-                "and can't be installed while this script is running. Please\n"
-                "install a more recent version first, using\n"
-                "'easy_install -U distribute'."
-                "\n\n(Currently using %r)\n" % (version, e.args[0]))
-                sys.exit(2)
-            else:
-                del pkg_resources, sys.modules['pkg_resources']    # reload ok
-                return _do_download(version, download_base, to_dir,
-                                    download_delay)
-        except pkg_resources.DistributionNotFound:
-            return _do_download(version, download_base, to_dir,
-                                download_delay)
-    finally:
-        if not no_fake:
-            _create_fake_setuptools_pkg_info(to_dir)
-
-
-def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
-                        to_dir=os.curdir, delay=15):
-    """Download distribute from a specified location and return its filename
-
-    `version` should be a valid distribute version number that is available
-    as an egg for download under the `download_base` URL (which should end
-    with a '/'). `to_dir` is the directory where the egg will be downloaded.
-    `delay` is the number of seconds to pause before an actual download
-    attempt.
-    """
-    # making sure we use the absolute path
-    to_dir = os.path.abspath(to_dir)
-    try:
-        from urllib.request import urlopen
-    except ImportError:
-        from urllib2 import urlopen
-    tgz_name = "distribute-%s.tar.gz" % version
-    url = download_base + tgz_name
-    saveto = os.path.join(to_dir, tgz_name)
-    src = dst = None
-    if not os.path.exists(saveto):  # Avoid repeated downloads
-        try:
-            log.warn("Downloading %s", url)
-            src = urlopen(url)
-            # Read/write all in one block, so we don't create a corrupt file
-            # if the download is interrupted.
-            data = src.read()
-            dst = open(saveto, "wb")
-            dst.write(data)
-        finally:
-            if src:
-                src.close()
-            if dst:
-                dst.close()
-    return os.path.realpath(saveto)
-
-
-def _no_sandbox(function):
-    def __no_sandbox(*args, **kw):
-        try:
-            from setuptools.sandbox import DirectorySandbox
-            if not hasattr(DirectorySandbox, '_old'):
-                def violation(*args):
-                    pass
-                DirectorySandbox._old = DirectorySandbox._violation
-                DirectorySandbox._violation = violation
-                patched = True
-            else:
-                patched = False
-        except ImportError:
-            patched = False
-
-        try:
-            return function(*args, **kw)
-        finally:
-            if patched:
-                DirectorySandbox._violation = DirectorySandbox._old
-                del DirectorySandbox._old
-
-    return __no_sandbox
-
-
-def _patch_file(path, content):
-    """Will backup the file then patch it"""
-    existing_content = open(path).read()
-    if existing_content == content:
-        # already patched
-        log.warn('Already patched.')
-        return False
-    log.warn('Patching...')
-    _rename_path(path)
-    f = open(path, 'w')
-    try:
-        f.write(content)
-    finally:
-        f.close()
-    return True
-
-_patch_file = _no_sandbox(_patch_file)
-
-
-def _same_content(path, content):
-    return open(path).read() == content
-
-
-def _rename_path(path):
-    new_name = path + '.OLD.%s' % time.time()
-    log.warn('Renaming %s to %s', path, new_name)
-    os.rename(path, new_name)
-    return new_name
-
-
-def _remove_flat_installation(placeholder):
-    if not os.path.isdir(placeholder):
-        log.warn('Unkown installation at %s', placeholder)
-        return False
-    found = False
-    for file in os.listdir(placeholder):
-        if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
-            found = True
-            break
-    if not found:
-        log.warn('Could not locate setuptools*.egg-info')
-        return
-
-    log.warn('Moving elements out of the way...')
-    pkg_info = os.path.join(placeholder, file)
-    if os.path.isdir(pkg_info):
-        patched = _patch_egg_dir(pkg_info)
-    else:
-        patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
-
-    if not patched:
-        log.warn('%s already patched.', pkg_info)
-        return False
-    # now let's move the files out of the way
-    for element in ('setuptools', 'pkg_resources.py', 'site.py'):
-        element = os.path.join(placeholder, element)
-        if os.path.exists(element):
-            _rename_path(element)
-        else:
-            log.warn('Could not find the %s element of the '
-                     'Setuptools distribution', element)
-    return True
-
-_remove_flat_installation = _no_sandbox(_remove_flat_installation)
-
-
-def _after_install(dist):
-    log.warn('After install bootstrap.')
-    placeholder = dist.get_command_obj('install').install_purelib
-    _create_fake_setuptools_pkg_info(placeholder)
-
-
-def _create_fake_setuptools_pkg_info(placeholder):
-    if not placeholder or not os.path.exists(placeholder):
-        log.warn('Could not find the install location')
-        return
-    pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
-    setuptools_file = 'setuptools-%s-py%s.egg-info' % \
-            (SETUPTOOLS_FAKED_VERSION, pyver)
-    pkg_info = os.path.join(placeholder, setuptools_file)
-    if os.path.exists(pkg_info):
-        log.warn('%s already exists', pkg_info)
-        return
-
-    log.warn('Creating %s', pkg_info)
-    try:
-        f = open(pkg_info, 'w')
-    except EnvironmentError:
-        log.warn("Don't have permissions to write %s, skipping", pkg_info)
-        return
-    try:
-        f.write(SETUPTOOLS_PKG_INFO)
-    finally:
-        f.close()
-
-    pth_file = os.path.join(placeholder, 'setuptools.pth')
-    log.warn('Creating %s', pth_file)
-    f = open(pth_file, 'w')
-    try:
-        f.write(os.path.join(os.curdir, setuptools_file))
-    finally:
-        f.close()
-
-_create_fake_setuptools_pkg_info = _no_sandbox(
-    _create_fake_setuptools_pkg_info
-)
-
-
-def _patch_egg_dir(path):
-    # let's check if it's already patched
-    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
-    if os.path.exists(pkg_info):
-        if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
-            log.warn('%s already patched.', pkg_info)
-            return False
-    _rename_path(path)
-    os.mkdir(path)
-    os.mkdir(os.path.join(path, 'EGG-INFO'))
-    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
-    f = open(pkg_info, 'w')
-    try:
-        f.write(SETUPTOOLS_PKG_INFO)
-    finally:
-        f.close()
-    return True
-
-_patch_egg_dir = _no_sandbox(_patch_egg_dir)
-
-
-def _before_install():
-    log.warn('Before install bootstrap.')
-    _fake_setuptools()
-
-
-def _under_prefix(location):
-    if 'install' not in sys.argv:
-        return True
-    args = sys.argv[sys.argv.index('install') + 1:]
-    for index, arg in enumerate(args):
-        for option in ('--root', '--prefix'):
-            if arg.startswith('%s=' % option):
-                top_dir = arg.split('root=')[-1]
-                return location.startswith(top_dir)
-            elif arg == option:
-                if len(args) > index:
-                    top_dir = args[index + 1]
-                    return location.startswith(top_dir)
-        if arg == '--user' and USER_SITE is not None:
-            return location.startswith(USER_SITE)
-    return True
-
-
-def _fake_setuptools():
-    log.warn('Scanning installed packages')
-    try:
-        import pkg_resources
-    except ImportError:
-        # we're cool
-        log.warn('Setuptools or Distribute does not seem to be installed.')
-        return
-    ws = pkg_resources.working_set
-    try:
-        setuptools_dist = ws.find(
-            pkg_resources.Requirement.parse('setuptools', replacement=False)
-            )
-    except TypeError:
-        # old distribute API
-        setuptools_dist = ws.find(
-            pkg_resources.Requirement.parse('setuptools')
-        )
-
-    if setuptools_dist is None:
-        log.warn('No setuptools distribution found')
-        return
-    # detecting if it was already faked
-    setuptools_location = setuptools_dist.location
-    log.warn('Setuptools installation detected at %s', setuptools_location)
-
-    # if --root or --preix was provided, and if
-    # setuptools is not located in them, we don't patch it
-    if not _under_prefix(setuptools_location):
-        log.warn('Not patching, --root or --prefix is installing Distribute'
-                 ' in another location')
-        return
-
-    # let's see if its an egg
-    if not setuptools_location.endswith('.egg'):
-        log.warn('Non-egg installation')
-        res = _remove_flat_installation(setuptools_location)
-        if not res:
-            return
-    else:
-        log.warn('Egg installation')
-        pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
-        if (os.path.exists(pkg_info) and
-            _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
-            log.warn('Already patched.')
-            return
-        log.warn('Patching...')
-        # let's create a fake egg replacing setuptools one
-        res = _patch_egg_dir(setuptools_location)
-        if not res:
-            return
-    log.warn('Patching complete.')
-    _relaunch()
-
-
-def _relaunch():
-    log.warn('Relaunching...')
-    # we have to relaunch the process
-    # pip marker to avoid a relaunch bug
-    _cmd1 = ['-c', 'install', '--single-version-externally-managed']
-    _cmd2 = ['-c', 'install', '--record']
-    if sys.argv[:3] == _cmd1 or sys.argv[:3] == _cmd2:
-        sys.argv[0] = 'setup.py'
-    args = [sys.executable] + sys.argv
-    sys.exit(subprocess.call(args))
-
-
-def _extractall(self, path=".", members=None):
-    """Extract all members from the archive to the current working
-       directory and set owner, modification time and permissions on
-       directories afterwards. `path' specifies a different directory
-       to extract to. `members' is optional and must be a subset of the
-       list returned by getmembers().
-    """
-    import copy
-    import operator
-    from tarfile import ExtractError
-    directories = []
-
-    if members is None:
-        members = self
-
-    for tarinfo in members:
-        if tarinfo.isdir():
-            # Extract directories with a safe mode.
-            directories.append(tarinfo)
-            tarinfo = copy.copy(tarinfo)
-            tarinfo.mode = 448  # decimal for oct 0700
-        self.extract(tarinfo, path)
-
-    # Reverse sort directories.
-    if sys.version_info < (2, 4):
-        def sorter(dir1, dir2):
-            return cmp(dir1.name, dir2.name)
-        directories.sort(sorter)
-        directories.reverse()
-    else:
-        directories.sort(key=operator.attrgetter('name'), reverse=True)
-
-    # Set correct owner, mtime and filemode on directories.
-    for tarinfo in directories:
-        dirpath = os.path.join(path, tarinfo.name)
-        try:
-            self.chown(tarinfo, dirpath)
-            self.utime(tarinfo, dirpath)
-            self.chmod(tarinfo, dirpath)
-        except ExtractError:
-            e = sys.exc_info()[1]
-            if self.errorlevel > 1:
-                raise
-            else:
-                self._dbg(1, "tarfile: %s" % e)
-
-
-def _build_install_args(options):
-    """
-    Build the arguments to 'python setup.py install' on the distribute package
-    """
-    install_args = []
-    if options.user_install:
-        if sys.version_info < (2, 6):
-            log.warn("--user requires Python 2.6 or later")
-            raise SystemExit(1)
-        install_args.append('--user')
-    return install_args
-
-def _parse_args():
-    """
-    Parse the command line for options
-    """
-    parser = optparse.OptionParser()
-    parser.add_option(
-        '--user', dest='user_install', action='store_true', default=False,
-        help='install in user site package (requires Python 2.6 or later)')
-    parser.add_option(
-        '--download-base', dest='download_base', metavar="URL",
-        default=DEFAULT_URL,
-        help='alternative URL from where to download the distribute package')
-    options, args = parser.parse_args()
-    # positional arguments are ignored
-    return options
-
-def main(version=DEFAULT_VERSION):
-    """Install or upgrade setuptools and EasyInstall"""
-    options = _parse_args()
-    tarball = download_setuptools(download_base=options.download_base)
-    return _install(tarball, _build_install_args(options))
-
-if __name__ == '__main__':
-    sys.exit(main())
deleted file mode 100644
--- a/python/virtualenv/virtualenv_embedded/ez_setup.py
+++ /dev/null
@@ -1,284 +0,0 @@
-#!python
-"""Bootstrap setuptools installation
-
-If you want to use setuptools in your package's setup.py, just include this
-file in the same directory with it, and add this to the top of your setup.py::
-
-    from ez_setup import use_setuptools
-    use_setuptools()
-
-If you want to require a specific version of setuptools, set a download
-mirror, or use an alternate download directory, you can do so by supplying
-the appropriate options to ``use_setuptools()``.
-
-This file can also be run as a script to install or upgrade setuptools.
-"""
-import sys
-DEFAULT_VERSION = "0.6c11"
-DEFAULT_URL     = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
-
-md5_data = {
-    'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
-    'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
-    'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
-    'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
-    'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
-    'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
-    'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
-    'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
-    'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
-    'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
-    'setuptools-0.6c10-py2.3.egg': 'ce1e2ab5d3a0256456d9fc13800a7090',
-    'setuptools-0.6c10-py2.4.egg': '57d6d9d6e9b80772c59a53a8433a5dd4',
-    'setuptools-0.6c10-py2.5.egg': 'de46ac8b1c97c895572e5e8596aeb8c7',
-    'setuptools-0.6c10-py2.6.egg': '58ea40aef06da02ce641495523a0b7f5',
-    'setuptools-0.6c11-py2.3.egg': '2baeac6e13d414a9d28e7ba5b5a596de',
-    'setuptools-0.6c11-py2.4.egg': 'bd639f9b0eac4c42497034dec2ec0c2b',
-    'setuptools-0.6c11-py2.5.egg': '64c94f3bf7a72a13ec83e0b24f2749b2',
-    'setuptools-0.6c11-py2.6.egg': 'bfa92100bd772d5a213eedd356d64086',
-    'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
-    'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
-    'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
-    'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
-    'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
-    'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
-    'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
-    'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
-    'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
-    'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
-    'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
-    'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
-    'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
-    'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
-    'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
-    'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
-    'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
-    'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
-    'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
-    'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
-    'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03',
-    'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a',
-    'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6',
-    'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a',
-}
-
-import sys, os
-try: from hashlib import md5
-except ImportError: from md5 import md5
-
-def _validate_md5(egg_name, data):
-    if egg_name in md5_data:
-        digest = md5(data).hexdigest()
-        if digest != md5_data[egg_name]:
-            print >>sys.stderr, (
-                "md5 validation of %s failed!  (Possible download problem?)"
-                % egg_name
-            )
-            sys.exit(2)
-    return data
-
-def use_setuptools(
-    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
-    download_delay=15
-):
-    """Automatically find/download setuptools and make it available on sys.path
-
-    `version` should be a valid setuptools version number that is available
-    as an egg for download under the `download_base` URL (which should end with
-    a '/').  `to_dir` is the directory where setuptools will be downloaded, if
-    it is not already available.  If `download_delay` is specified, it should
-    be the number of seconds that will be paused before initiating a download,
-    should one be required.  If an older version of setuptools is installed,
-    this routine will print a message to ``sys.stderr`` and raise SystemExit in
-    an attempt to abort the calling script.
-    """
-    was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
-    def do_download():
-        egg = download_setuptools(version, download_base, to_dir, download_delay)
-        sys.path.insert(0, egg)
-        import setuptools; setuptools.bootstrap_install_from = egg
-    try:
-        import pkg_resources
-    except ImportError:
-        return do_download()       
-    try:
-        pkg_resources.require("setuptools>="+version); return
-    except pkg_resources.VersionConflict, e:
-        if was_imported:
-            print >>sys.stderr, (
-            "The required version of setuptools (>=%s) is not available, and\n"
-            "can't be installed while this script is running. Please install\n"
-            " a more recent version first, using 'easy_install -U setuptools'."
-            "\n\n(Currently using %r)"
-            ) % (version, e.args[0])
-            sys.exit(2)
-    except pkg_resources.DistributionNotFound:
-        pass
-
-    del pkg_resources, sys.modules['pkg_resources']    # reload ok
-    return do_download()
-
-def download_setuptools(
-    version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
-    delay = 15
-):
-    """Download setuptools from a specified location and return its filename
-
-    `version` should be a valid setuptools version number that is available
-    as an egg for download under the `download_base` URL (which should end
-    with a '/'). `to_dir` is the directory where the egg will be downloaded.
-    `delay` is the number of seconds to pause before an actual download attempt.
-    """
-    import urllib2, shutil
-    egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
-    url = download_base + egg_name
-    saveto = os.path.join(to_dir, egg_name)
-    src = dst = None
-    if not os.path.exists(saveto):  # Avoid repeated downloads
-        try:
-            from distutils import log
-            if delay:
-                log.warn("""
----------------------------------------------------------------------------
-This script requires setuptools version %s to run (even to display
-help).  I will attempt to download it for you (from
-%s), but
-you may need to enable firewall access for this script first.
-I will start the download in %d seconds.
-
-(Note: if this machine does not have network access, please obtain the file
-
-   %s
-
-and place it in this directory before rerunning this script.)
----------------------------------------------------------------------------""",
-                    version, download_base, delay, url
-                ); from time import sleep; sleep(delay)
-            log.warn("Downloading %s", url)
-            src = urllib2.urlopen(url)
-            # Read/write all in one block, so we don't create a corrupt file
-            # if the download is interrupted.
-            data = _validate_md5(egg_name, src.read())
-            dst = open(saveto,"wb"); dst.write(data)
-        finally:
-            if src: src.close()
-            if dst: dst.close()
-    return os.path.realpath(saveto)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-def main(argv, version=DEFAULT_VERSION):
-    """Install or upgrade setuptools and EasyInstall"""
-    try:
-        import setuptools
-    except ImportError:
-        egg = None
-        try:
-            egg = download_setuptools(version, delay=0)
-            sys.path.insert(0,egg)
-            from setuptools.command.easy_install import main
-            return main(list(argv)+[egg])   # we're done here
-        finally:
-            if egg and os.path.exists(egg):
-                os.unlink(egg)
-    else:
-        if setuptools.__version__ == '0.0.1':
-            print >>sys.stderr, (