Mercurial > hg
comparison mercurial/commands.py @ 17887:0e2846b2482c stable
url: use open and not url.open for local files (issue3624)
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 17 Oct 2012 21:30:08 -0700 |
parents | 92ba3cd55be6 |
children | ba0a1701c81a |
comparison
equal
deleted
inserted
replaced
17886:d8905e2c1301 | 17887:0e2846b2482c |
---|---|
8 from node import hex, bin, nullid, nullrev, short | 8 from node import hex, bin, nullid, nullrev, short |
9 from lock import release | 9 from lock import release |
10 from i18n import _, gettext | 10 from i18n import _, gettext |
11 import os, re, difflib, time, tempfile, errno | 11 import os, re, difflib, time, tempfile, errno |
12 import hg, scmutil, util, revlog, extensions, copies, error, bookmarks | 12 import hg, scmutil, util, revlog, extensions, copies, error, bookmarks |
13 import patch, help, url, encoding, templatekw, discovery | 13 import patch, help, encoding, templatekw, discovery |
14 import archival, changegroup, cmdutil, hbisect | 14 import archival, changegroup, cmdutil, hbisect |
15 import sshserver, hgweb, hgweb.server, commandserver | 15 import sshserver, hgweb, hgweb.server, commandserver |
16 import merge as mergemod | 16 import merge as mergemod |
17 import minirst, revset, fileset | 17 import minirst, revset, fileset |
18 import dagparser, context, simplemerge, graphmod | 18 import dagparser, context, simplemerge, graphmod |
1588 release(tr, lock) | 1588 release(tr, lock) |
1589 | 1589 |
1590 @command('debugbundle', [('a', 'all', None, _('show all details'))], _('FILE')) | 1590 @command('debugbundle', [('a', 'all', None, _('show all details'))], _('FILE')) |
1591 def debugbundle(ui, bundlepath, all=None, **opts): | 1591 def debugbundle(ui, bundlepath, all=None, **opts): |
1592 """lists the contents of a bundle""" | 1592 """lists the contents of a bundle""" |
1593 f = url.open(ui, bundlepath) | 1593 f = hg.openpath(ui, bundlepath) |
1594 try: | 1594 try: |
1595 gen = changegroup.readbundle(f, bundlepath) | 1595 gen = changegroup.readbundle(f, bundlepath) |
1596 if all: | 1596 if all: |
1597 ui.write("format: id, p1, p2, cset, delta base, len(delta)\n") | 1597 ui.write("format: id, p1, p2, cset, delta base, len(delta)\n") |
1598 | 1598 |
3854 patchfile = ui.fin | 3854 patchfile = ui.fin |
3855 patchurl = 'stdin' # for error message | 3855 patchurl = 'stdin' # for error message |
3856 else: | 3856 else: |
3857 patchurl = os.path.join(base, patchurl) | 3857 patchurl = os.path.join(base, patchurl) |
3858 ui.status(_('applying %s\n') % patchurl) | 3858 ui.status(_('applying %s\n') % patchurl) |
3859 patchfile = url.open(ui, patchurl) | 3859 patchfile = hg.openpath(ui, patchurl) |
3860 | 3860 |
3861 haspatch = False | 3861 haspatch = False |
3862 for hunk in patch.split(patchfile): | 3862 for hunk in patch.split(patchfile): |
3863 (msg, node) = tryone(ui, hunk, parents) | 3863 (msg, node) = tryone(ui, hunk, parents) |
3864 if msg: | 3864 if msg: |
5802 | 5802 |
5803 lock = repo.lock() | 5803 lock = repo.lock() |
5804 wc = repo['.'] | 5804 wc = repo['.'] |
5805 try: | 5805 try: |
5806 for fname in fnames: | 5806 for fname in fnames: |
5807 f = url.open(ui, fname) | 5807 f = hg.openpath(ui, fname) |
5808 gen = changegroup.readbundle(f, fname) | 5808 gen = changegroup.readbundle(f, fname) |
5809 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) | 5809 modheads = repo.addchangegroup(gen, 'unbundle', 'bundle:' + fname) |
5810 finally: | 5810 finally: |
5811 lock.release() | 5811 lock.release() |
5812 bookmarks.updatecurrentbookmark(repo, wc.node(), wc.branch()) | 5812 bookmarks.updatecurrentbookmark(repo, wc.node(), wc.branch()) |