# HG changeset patch # User Matt Mackall # Date 2014-03-25 21:17:16 # Node ID 9a09a625bc93ab69248613abcbea041b785f1a0e # Parent 3210b79308994a464f8d0876e0c0da66cec79677 # Parent dd2e25e49862213c73b5ea3412aa1fa5d8c92bab merge with stable diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -108,13 +108,17 @@ def _runcatch(req): # if we are in HGPLAIN mode, then disable custom debugging debugger = ui.config("ui", "debugger") + debugmod = pdb if not debugger or ui.plain(): debugger = 'pdb' - - try: - debugmod = __import__(debugger) - except ImportError: - debugmod = pdb + elif '--debugger' in req.args: + # This import can be slow for fancy debuggers, so only + # do it when absolutely necessary, i.e. when actual + # debugging has been requested + try: + debugmod = __import__(debugger) + except ImportError: + pass # Leave debugmod = pdb debugtrace[debugger] = debugmod.set_trace debugmortem[debugger] = debugmod.post_mortem diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -230,8 +230,10 @@ def copystore(ui, srcrepo, destpath): dstvfs.mkdir(dstbase) if srcvfs.exists(f): if f.endswith('data'): + # 'dstbase' may be empty (e.g. revlog format 0) + lockfile = os.path.join(dstbase, "lock") # lock to avoid premature writing to the target - destlock = lock.lock(dstvfs, dstbase + "/lock") + destlock = lock.lock(dstvfs, lockfile) hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f), hardlink) num += n diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1594,6 +1594,10 @@ def _substringmatcher(pattern): def tag(repo, subset, x): """``tag([name])`` The specified tag by name, or all tagged revisions if no name is given. + + If `name` starts with `re:`, the remainder of the name is treated as + a regular expression. To match a tag that actually starts with `re:`, + use the prefix `literal:`. """ # i18n: "tag" is a keyword args = getargs(x, 0, 1, _("tag takes one or no arguments")) diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -621,3 +621,17 @@ re-enable perm to allow deletion #endif $ cd .. + +Test clone from the repository in (emulated) revlog format 0 (issue4203): + + $ mkdir issue4203 + $ mkdir -p src/.hg + $ echo foo > src/foo + $ hg -R src add src/foo + $ hg -R src commit -m '#0' + $ hg -R src log -q + 0:e1bab28bca43 + $ hg clone -U -q src dst + $ hg -R dst log -q + 0:e1bab28bca43 + $ cd ..