changeset 26030:5243890224ff

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 13 Aug 2015 19:37:47 -0500
parents 84c00f03e06c (current diff) 563ea14c62d4 (diff)
children 0b57b77f9b3e
files mercurial/commands.py mercurial/hg.py
diffstat 10 files changed, 108 insertions(+), 81 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py	Wed Aug 12 19:44:21 2015 -0700
+++ b/hgext/largefiles/lfutil.py	Thu Aug 13 19:37:47 2015 -0500
@@ -247,6 +247,8 @@
 
     if rmatcher and not rmatcher.always():
         pats = [os.path.join(standindir, pat) for pat in rmatcher.files()]
+        if not pats:
+            pats = [standindir]
         match = scmutil.match(repo[None], pats, badfn=badfn)
         # if pats is empty, it would incorrectly always match, so clear _always
         match._always = False
--- a/hgext/rebase.py	Wed Aug 12 19:44:21 2015 -0700
+++ b/hgext/rebase.py	Thu Aug 13 19:37:47 2015 -0500
@@ -1026,40 +1026,46 @@
 def pullrebase(orig, ui, repo, *args, **opts):
     'Call rebase after pull if the latter has been invoked with --rebase'
     if opts.get('rebase'):
-        if opts.get('update'):
-            del opts['update']
-            ui.debug('--update and --rebase are not compatible, ignoring '
-                     'the update flag\n')
+        wlock = lock = None
+        try:
+            wlock = repo.wlock()
+            lock = repo.lock()
+            if opts.get('update'):
+                del opts['update']
+                ui.debug('--update and --rebase are not compatible, ignoring '
+                         'the update flag\n')
 
-        movemarkfrom = repo['.'].node()
-        revsprepull = len(repo)
-        origpostincoming = commands.postincoming
-        def _dummy(*args, **kwargs):
-            pass
-        commands.postincoming = _dummy
-        try:
-            orig(ui, repo, *args, **opts)
+            movemarkfrom = repo['.'].node()
+            revsprepull = len(repo)
+            origpostincoming = commands.postincoming
+            def _dummy(*args, **kwargs):
+                pass
+            commands.postincoming = _dummy
+            try:
+                orig(ui, repo, *args, **opts)
+            finally:
+                commands.postincoming = origpostincoming
+            revspostpull = len(repo)
+            if revspostpull > revsprepull:
+                # --rev option from pull conflict with rebase own --rev
+                # dropping it
+                if 'rev' in opts:
+                    del opts['rev']
+                # positional argument from pull conflicts with rebase's own
+                # --source.
+                if 'source' in opts:
+                    del opts['source']
+                rebase(ui, repo, **opts)
+                branch = repo[None].branch()
+                dest = repo[branch].rev()
+                if dest != repo['.'].rev():
+                    # there was nothing to rebase we force an update
+                    hg.update(repo, dest)
+                    if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
+                        ui.status(_("updating bookmark %s\n")
+                                  % repo._activebookmark)
         finally:
-            commands.postincoming = origpostincoming
-        revspostpull = len(repo)
-        if revspostpull > revsprepull:
-            # --rev option from pull conflict with rebase own --rev
-            # dropping it
-            if 'rev' in opts:
-                del opts['rev']
-            # positional argument from pull conflicts with rebase's own
-            # --source.
-            if 'source' in opts:
-                del opts['source']
-            rebase(ui, repo, **opts)
-            branch = repo[None].branch()
-            dest = repo[branch].rev()
-            if dest != repo['.'].rev():
-                # there was nothing to rebase we force an update
-                hg.update(repo, dest)
-                if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
-                    ui.status(_("updating bookmark %s\n")
-                              % repo._activebookmark)
+            release(lock, wlock)
     else:
         if opts.get('tool'):
             raise util.Abort(_('--tool can only be used with --rebase'))
--- a/mercurial/commands.py	Wed Aug 12 19:44:21 2015 -0700
+++ b/mercurial/commands.py	Thu Aug 13 19:37:47 2015 -0500
@@ -6475,51 +6475,55 @@
     if rev is None or rev == '':
         rev = node
 
-    cmdutil.clearunfinished(repo)
-
-    # with no argument, we also move the active bookmark, if any
-    rev, movemarkfrom = bookmarks.calculateupdate(ui, repo, rev)
-
-    # if we defined a bookmark, we have to remember the original bookmark name
-    brev = rev
-    rev = scmutil.revsingle(repo, rev, rev).rev()
-
-    if check and clean:
-        raise util.Abort(_("cannot specify both -c/--check and -C/--clean"))
-
-    if date:
-        if rev is not None:
-            raise util.Abort(_("you can't specify a revision and a date"))
-        rev = cmdutil.finddate(ui, repo, date)
-
-    if check:
-        cmdutil.bailifchanged(repo, merge=False)
-        if rev is None:
-            rev = repo[repo[None].branch()].rev()
-
-    repo.ui.setconfig('ui', 'forcemerge', tool, 'update')
-
-    if clean:
-        ret = hg.clean(repo, rev)
-    else:
-        ret = hg.update(repo, rev)
-
-    if not ret and movemarkfrom:
-        if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
-            ui.status(_("updating bookmark %s\n") % repo._activebookmark)
+    wlock = repo.wlock()
+    try:
+        cmdutil.clearunfinished(repo)
+
+        # with no argument, we also move the active bookmark, if any
+        rev, movemarkfrom = bookmarks.calculateupdate(ui, repo, rev)
+
+        # if we defined a bookmark, we have to remember the original name
+        brev = rev
+        rev = scmutil.revsingle(repo, rev, rev).rev()
+
+        if check and clean:
+            raise util.Abort(_("cannot specify both -c/--check and -C/--clean"))
+
+        if date:
+            if rev is not None:
+                raise util.Abort(_("you can't specify a revision and a date"))
+            rev = cmdutil.finddate(ui, repo, date)
+
+        if check:
+            cmdutil.bailifchanged(repo, merge=False)
+            if rev is None:
+                rev = repo[repo[None].branch()].rev()
+
+        repo.ui.setconfig('ui', 'forcemerge', tool, 'update')
+
+        if clean:
+            ret = hg.clean(repo, rev)
         else:
-            # this can happen with a non-linear update
-            ui.status(_("(leaving bookmark %s)\n") %
-                      repo._activebookmark)
+            ret = hg.update(repo, rev)
+
+        if not ret and movemarkfrom:
+            if bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
+                ui.status(_("updating bookmark %s\n") % repo._activebookmark)
+            else:
+                # this can happen with a non-linear update
+                ui.status(_("(leaving bookmark %s)\n") %
+                          repo._activebookmark)
+                bookmarks.deactivate(repo)
+        elif brev in repo._bookmarks:
+            bookmarks.activate(repo, brev)
+            ui.status(_("(activating bookmark %s)\n") % brev)
+        elif brev:
+            if repo._activebookmark:
+                ui.status(_("(leaving bookmark %s)\n") %
+                          repo._activebookmark)
             bookmarks.deactivate(repo)
-    elif brev in repo._bookmarks:
-        bookmarks.activate(repo, brev)
-        ui.status(_("(activating bookmark %s)\n") % brev)
-    elif brev:
-        if repo._activebookmark:
-            ui.status(_("(leaving bookmark %s)\n") %
-                      repo._activebookmark)
-        bookmarks.deactivate(repo)
+    finally:
+        wlock.release()
 
     return ret
 
--- a/mercurial/help/scripting.txt	Wed Aug 12 19:44:21 2015 -0700
+++ b/mercurial/help/scripting.txt	Thu Aug 13 19:37:47 2015 -0500
@@ -56,7 +56,7 @@
    incorrectly (often by using "?" as a placeholder for invalid
    characters in the current locale).
 
-   Explcitly setting this environment variable is a good practice to
+   Explicitly setting this environment variable is a good practice to
    guarantee consistent results. "utf-8" is a good choice on UNIX-like
    environments.
 
--- a/mercurial/hg.py	Wed Aug 12 19:44:21 2015 -0700
+++ b/mercurial/hg.py	Thu Aug 13 19:37:47 2015 -0500
@@ -428,7 +428,7 @@
     shareopts = shareopts or {}
     sharepool = shareopts.get('pool')
     sharenamemode = shareopts.get('mode')
-    if sharepool:
+    if sharepool and islocal(dest):
         sharepath = None
         if sharenamemode == 'identity':
             # Resolve the name from the initial changeset in the remote
--- a/tests/test-blackbox.t	Wed Aug 12 19:44:21 2015 -0700
+++ b/tests/test-blackbox.t	Thu Aug 13 19:37:47 2015 -0500
@@ -119,8 +119,8 @@
   $ echo '[hooks]' >> .hg/hgrc
   $ echo 'update = echo hooked' >> .hg/hgrc
   $ hg update
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   hooked
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg blackbox -l 5
   1970/01/01 00:00:00 bob> update
   1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 0 tags
--- a/tests/test-clone.t	Wed Aug 12 19:44:21 2015 -0700
+++ b/tests/test-clone.t	Thu Aug 13 19:37:47 2015 -0500
@@ -1013,3 +1013,15 @@
   adding remote bookmark bookA
 
   $ ls share-1anowc
+
+Test that auto sharing doesn't cause failure of "hg clone local remote"
+
+  $ cd $TESTTMP
+  $ hg -R a id -r 0
+  acb14030fe0a
+  $ hg id -R remote -r 0
+  abort: there is no Mercurial repository here (.hg not found)
+  [255]
+  $ hg --config share.pool=share -q clone -e "python \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
+  $ hg -R remote id -r 0
+  acb14030fe0a
--- a/tests/test-histedit-fold.t	Wed Aug 12 19:44:21 2015 -0700
+++ b/tests/test-histedit-fold.t	Thu Aug 13 19:37:47 2015 -0500
@@ -505,4 +505,8 @@
   1:9599899f62c0 a
   0:79b99e9c8e49 b
 
+  $ echo "foo" > amended.txt
+  $ hg add amended.txt
+  $ hg ci -q --config extensions.largefiles= --amend -I amended.txt
+
   $ cd ..
--- a/tests/test-hook.t	Wed Aug 12 19:44:21 2015 -0700
+++ b/tests/test-hook.t	Thu Aug 13 19:37:47 2015 -0500
@@ -223,8 +223,8 @@
   $ echo "update = printenv.py update" >> .hg/hgrc
   $ hg update
   preupdate hook: HG_PARENT1=539e4b31b6dc
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   update hook: HG_ERROR=0 HG_PARENT1=539e4b31b6dc
-  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 pushkey hook
 
@@ -644,8 +644,8 @@
   $ hg ci -ma
   223eafe2750c tip
   $ hg up 0 --config extensions.largefiles=
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   cb9a9f314b8b
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 
 make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui
 that is passed to pre/post hooks
--- a/tests/test-lock-badness.t	Wed Aug 12 19:44:21 2015 -0700
+++ b/tests/test-lock-badness.t	Thu Aug 13 19:37:47 2015 -0500
@@ -59,7 +59,6 @@
   $ hg -R b up -q --config hooks.pre-update="python:`pwd`/hooks.py:sleephalf"
   waiting for lock on working directory of b held by '*:*' (glob)
   got lock after ? seconds (glob)
-  warning: ignoring unknown working parent d2ae7f538514!
   $ wait
   $ cat stdout
   adding b