changeset 5205:ce4e67533723

add import from url capability
author rupert.thurner@gmail.com
date Mon, 20 Aug 2007 22:02:05 +0200
parents 6f636d13f6b8
children 6a1d2dd96b8e
files mercurial/commands.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Aug 19 17:38:40 2007 +0200
+++ b/mercurial/commands.py	Mon Aug 20 22:02:05 2007 +0200
@@ -1567,8 +1567,10 @@
                 data = patch.extract(ui, sys.stdin)
             else:
                 ui.status(_("applying %s\n") % p)
-                data = patch.extract(ui, file(pf, 'rb'))
-
+                if os.path.exists(pf):
+                    data = patch.extract(ui, file(pf, 'rb'))
+                else:
+                    data = patch.extract(ui, urllib.urlopen(pf))
             tmpname, message, user, date, branch, nodeid, p1, p2 = data
 
             if tmpname is None: