Show More
@@ -33,8 +33,8 from mercurial.i18n import _ | |||||
33 | from mercurial.node import bin, hex, short |
|
33 | from mercurial.node import bin, hex, short | |
34 | from mercurial.repo import RepoError |
|
34 | from mercurial.repo import RepoError | |
35 | from mercurial import commands, cmdutil, hg, patch, revlog, util |
|
35 | from mercurial import commands, cmdutil, hg, patch, revlog, util | |
36 | from mercurial import repair, extensions |
|
36 | from mercurial import repair, extensions, url | |
37 |
import os, sys, re, errno |
|
37 | import os, sys, re, errno | |
38 |
|
38 | |||
39 | commands.norepo += " qclone" |
|
39 | commands.norepo += " qclone" | |
40 |
|
40 | |||
@@ -1521,10 +1521,7 class queue: | |||||
1521 | raise util.Abort(_('need --name to import a patch from -')) |
|
1521 | raise util.Abort(_('need --name to import a patch from -')) | |
1522 | text = sys.stdin.read() |
|
1522 | text = sys.stdin.read() | |
1523 | else: |
|
1523 | else: | |
1524 |
|
|
1524 | text = url.open(self.ui, filename).read() | |
1525 | text = file(filename, 'rb').read() |
|
|||
1526 | else: |
|
|||
1527 | text = urllib.urlopen(filename).read() |
|
|||
1528 | except IOError: |
|
1525 | except IOError: | |
1529 | raise util.Abort(_("unable to read %s") % filename) |
|
1526 | raise util.Abort(_("unable to read %s") % filename) | |
1530 | if not patchname: |
|
1527 | if not patchname: |
@@ -8,7 +8,7 | |||||
8 | from node import hex, nullid, nullrev, short |
|
8 | from node import hex, nullid, nullrev, short | |
9 | from repo import RepoError, NoCapability |
|
9 | from repo import RepoError, NoCapability | |
10 | from i18n import _, gettext |
|
10 | from i18n import _, gettext | |
11 |
import os, re, sys |
|
11 | import os, re, sys | |
12 | import hg, util, revlog, bundlerepo, extensions, copies |
|
12 | import hg, util, revlog, bundlerepo, extensions, copies | |
13 | import difflib, patch, time, help, mdiff, tempfile, url |
|
13 | import difflib, patch, time, help, mdiff, tempfile, url | |
14 | import version, socket |
|
14 | import version, socket | |
@@ -1590,13 +1590,11 def import_(ui, repo, patch1, *patches, | |||||
1590 |
|
1590 | |||
1591 | if pf == '-': |
|
1591 | if pf == '-': | |
1592 | ui.status(_("applying patch from stdin\n")) |
|
1592 | ui.status(_("applying patch from stdin\n")) | |
1593 |
|
|
1593 | pf = sys.stdin | |
1594 | else: |
|
1594 | else: | |
1595 | ui.status(_("applying %s\n") % p) |
|
1595 | ui.status(_("applying %s\n") % p) | |
1596 |
|
|
1596 | pf = url.open(ui, pf) | |
1597 |
|
|
1597 | data = patch.extract(ui, pf) | |
1598 | else: |
|
|||
1599 | data = patch.extract(ui, urllib.urlopen(pf)) |
|
|||
1600 | tmpname, message, user, date, branch, nodeid, p1, p2 = data |
|
1598 | tmpname, message, user, date, branch, nodeid, p1, p2 = data | |
1601 |
|
1599 | |||
1602 | if tmpname is None: |
|
1600 | if tmpname is None: | |
@@ -2844,10 +2842,7 def unbundle(ui, repo, fname1, *fnames, | |||||
2844 | try: |
|
2842 | try: | |
2845 | lock = repo.lock() |
|
2843 | lock = repo.lock() | |
2846 | for fname in fnames: |
|
2844 | for fname in fnames: | |
2847 |
|
|
2845 | f = url.open(ui, fname) | |
2848 | f = open(fname, "rb") |
|
|||
2849 | else: |
|
|||
2850 | f = urllib.urlopen(fname) |
|
|||
2851 | gen = changegroup.readbundle(f, fname) |
|
2846 | gen = changegroup.readbundle(f, fname) | |
2852 | modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) |
|
2847 | modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | |
2853 | finally: |
|
2848 | finally: |
1 | NO CONTENT: modified file chmod 100755 => 100644 |
|
NO CONTENT: modified file chmod 100755 => 100644 |
@@ -25,7 +25,7 hg init repo | |||||
25 | cd repo |
|
25 | cd repo | |
26 |
|
26 | |||
27 | echo % qimport non-existing-file |
|
27 | echo % qimport non-existing-file | |
28 | hg qimport non-existing-file |
|
28 | hg qimport non-existing-file 2>&1 | sed -e 's/\(No such file or directory:\) .*/\1/' | |
29 |
|
29 | |||
30 | echo % import URL |
|
30 | echo % import URL | |
31 | echo foo >> foo |
|
31 | echo foo >> foo |
General Comments 0
You need to be logged in to leave comments.
Login now