Joshua Redstone | 24 May 16:50

[PATCH] localrepo: Add locking to _branchtags around _writebrancache

# HG changeset patch
# User Joshua Redstone <joshua.redstone <at> fb.com>
# Date 1336812429 25200
# Node ID b3bb1d7360c481b847431fc0d264111b1d93f993
# Parent  2ac08d8b21aa7b6e0a062afed5a3f357ccef67f9
localrepo:  Add locking to _branchtags around _writebrancache

Read code paths such as via localrepo.branchmap() may end up calling
_writebranchcache without having acquire a repo lock, potentially leading to
races with other repo mutations.  This fix acquires the repo lock if not yet
held before calling _writebranchcache.

diff -r 2ac08d8b21aa -r b3bb1d7360c4 mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue May 22 14:37:20 2012 -0500
+++ b/mercurial/localrepo.py	Sat May 12 01:47:09 2012 -0700
@@ -481,8 +481,18 @@
         if lrev != tiprev:
             ctxgen = (self[r] for r in xrange(lrev + 1, tiprev + 1))
             self._updatebranchcache(partial, ctxgen)
-            self._writebranchcache(partial, self.changelog.tip(), tiprev)
-
+            # Read code paths (e.g., from branchmap()) do not have the lock
+            # yet.  Lock acquisition may fail if we do not have write-access
+            # to the directory.
+            try:
+                wlock = self.wlock(wait=False)
+                try:
+                    self._writebranchcache(partial, self.changelog.tip(),
+                                           tiprev)
+                finally:
(Continue reading)

Patrick Mezard | 24 May 13:49
Picon

[PATCH] revset: cache alias expansions

# HG changeset patch
# User Patrick Mezard <patrick <at> mezard.eu>
# Date 1337857506 -7200
# Node ID f5171e8248a20b23f0404a6f41c1c88390060e60
# Parent  2ac08d8b21aa7b6e0a062afed5a3f357ccef67f9
revset: cache alias expansions

Caching has no performance effect on the revset aliases which triggered
the recent recursive evaluation bug. I wrote it not to feel bad about
expanding several times the same complicated expression.

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1387,7 +1387,7 @@
         return args[arg]
     return tuple(_expandargs(t, args) for t in tree)

-def _expandaliases(aliases, tree, expanding):
+def _expandaliases(aliases, tree, expanding, cache):
     """Expand aliases in tree, recursively.

     'aliases' is a dictionary mapping user defined aliases to
@@ -1402,17 +1402,20 @@
             raise error.ParseError(_('infinite expansion of revset alias "%s" '
                                      'detected') % alias.name)
         expanding.append(alias)
-        result = _expandaliases(aliases, alias.replacement, expanding)
+        if alias.name not in cache:
+            cache[alias.name] = _expandaliases(aliases, alias.replacement,
(Continue reading)

Mercurial Commits | 24 May 13:00
Favicon

mercurial/crew <at> 16782: 4 outgoing changesets

4 outgoing changesets in mercurial/crew:

http://hg.intevation.org/mercurial/crew/rev/e9ae770eff1c
changeset:   16782:e9ae770eff1c
tag:         tip
user:        Thomas Arendsen Hein <thomas <at> intevation.de>
date:        Wed May 23 21:34:29 2012 +0200
summary:     merge: show renamed on one and deleted on the other side in debug output

http://hg.intevation.org/mercurial/crew/rev/98687cdddcb1
changeset:   16781:98687cdddcb1
user:        Thomas Arendsen Hein <thomas <at> intevation.de>
date:        Wed May 23 20:50:16 2012 +0200
summary:     merge: warn about file deleted in one branch and renamed in other (issue3074)

http://hg.intevation.org/mercurial/crew/rev/9cbc44a6600e
changeset:   16780:9cbc44a6600e
user:        Thomas Arendsen Hein <thomas <at> intevation.de>
date:        Wed May 23 17:33:19 2012 +0200
summary:     tests: do not create repos inside repos in test-rename-merge1.t

http://hg.intevation.org/mercurial/crew/rev/ad394c897b16
changeset:   16779:ad394c897b16
user:        Thomas Arendsen Hein <thomas <at> intevation.de>
date:        Wed May 23 17:25:48 2012 +0200
summary:     merge: do not warn about copy and rename in the same transaction (issue2113)

--

-- 
Repository URL: http://hg.intevation.org/mercurial/crew
(Continue reading)

Adrian Buehlmann | 24 May 12:04
Favicon

[PATCH] base85: use Py_ssize_t for string lengths

# HG changeset patch
# User Adrian Buehlmann <adrian <at> cadifra.com>
# Date 1337815812 -7200
# Node ID e7a3700ed766935900bda57eb9bfa8cc4ca36381
# Parent  2ac08d8b21aa7b6e0a062afed5a3f357ccef67f9
base85: use Py_ssize_t for string lengths

diff --git a/mercurial/base85.c b/mercurial/base85.c
--- a/mercurial/base85.c
+++ b/mercurial/base85.c
@@ -9,6 +9,7 @@
  Largely based on git's implementation
 */

+#define PY_SSIZE_T_CLEAN
 #include <Python.h>

 #include "util.h"
@@ -33,7 +34,7 @@
 	const unsigned char *text;
 	PyObject *out;
 	char *dst;
-	int len, olen, i;
+	Py_ssize_t len, olen, i;
 	unsigned int acc, val, ch;
 	int pad = 0;

@@ -81,7 +82,8 @@
 	PyObject *out;
 	const char *text;
(Continue reading)

Joshua Redstone | 23 May 23:18

strip v4 patch

Hi Matt,
I just updated the patch I sent yesterday - I thought of another corner 
case I wasn't handling - that if the set of branches that have nodes 
stripped and the set of branches of their parents are not the same, 
though both are of size 1.  I also added an additional test case to 
exercise that scenario.

--

-- 
Josh

Joshua Redstone | 23 May 23:15

[PATCH v4] strip: incrementally update the branchheads cache after a strip

# HG changeset patch
# User Joshua Redstone <joshua.redstone <at> fb.com>
# Date 1337370347 25200
# Node ID cb504dab484a34f21656fc594f0a58f65a653a23
# Parent  d0b9ebba41e9a1733294d5fa1b497ada5eda93c8
strip: incrementally update the branchheads cache after a strip

This function augments strip to incrementally update the branchheads cache
rather than recompute it from scratch.  This speeds up the performance of strip
and rebase on repos with long history.  The performance optimization only
happens if the revisions stripped are all on the same branch and the parents of
the stripped revisions are also on that same branch.

This also fixes a small performance bug in localrepo._updatebranchcache.  That
function would iterate over new candidate heads in order from oldest to newest,
in contrast to the comment that observes that iterating from newest to oldest
results in fewer pases over the set of reachable nodes.

This adds a few test cases, particularly one that reproduces the extra heads
that mpm observed.

diff -r d0b9ebba41e9 -r cb504dab484a hgext/mq.py
--- a/hgext/mq.py	Sun May 20 14:40:36 2012 -0500
+++ b/hgext/mq.py	Fri May 18 12:45:47 2012 -0700
@@ -3449,7 +3449,7 @@
             if start < qbase:
                 # update the cache (excluding the patches) and save it
                 ctxgen = (self[r] for r in xrange(lrev + 1, qbase))
-                self._updatebranchcache(partial, ctxgen)
+                self._updatebranchcache(partial, ctxgen, ctxisnew=True)
(Continue reading)

hgbuildbot | 23 May 22:58

buildbot failure in Mercurial on hg tests

The Buildbot has detected a new failure on builder hg tests while building hg.
Full details are available at:
 http://hgbuildbot.kublai.com/builders/hg%20tests/builds/121

Buildbot URL: http://hgbuildbot.kublai.com/

Buildslave for this Build: l6

Build Reason: scheduler
Build Source Stamp: [branch default] e9ae770eff1c5728eb397e0bd413af6b93e78a5f
Blamelist: Thomas Arendsen Hein <thomas <at> intevation.de>

BUILD FAILED: failed run-tests.py (python2.6)

sincerely,
 -The Buildbot

bugzilla-daemon | 23 May 09:38
Favicon

[Bug 3468] New: shell alias: not possible to honor -R

http://bz.selenic.com/show_bug.cgi?id=3468

          Priority: normal
            Bug ID: 3468
                CC: mercurial-devel <at> selenic.com
          Assignee: bugzilla <at> selenic.com
           Summary: shell alias: not possible to honor -R
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: patrickdepinguin+mercurial <at> gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: earlier
         Component: Mercurial
           Product: Mercurial

In shell aliases you can use $HG to refer to the hg binary, and $HG_ARGS to
refer to the options given to the alias command.

However, when you run an alias with -R, as in:
hg myalias -R somerepo
there is no way for the alias to know about 'somerepo', because it is neither
in $HG nor in $HG_ARGS.

This is troublesome for aliases that wrap around existing Mercurial commands,
like:

deliverylog = !args=`echo $HG_ARGS | cut -s -d' '  -f2-`; 
            cmd="$HG log --rev 'sort( user(\"Official delivery\") and branch(.)
(Continue reading)

FUJIWARA Katsunori | 23 May 14:38
Picon

RFC: safe pattern matching for problematic encoding

Hi, devels.

I'm working to achieve safe pattern matching/parsing for problematic
encodings (e.g.: cp932), in which strings may contain '\\' as a part
of multi-byte characters.

I finished to write draft version patch series to do it, but it
requires changes as below:

  (1) add hooks to replace '\' in mbcs by '\x5c' before:

      - re.compile() invocation from:
        - grep() in command.py
        - grep() in fileset.py
        - grep() in revset.py

      - re.escape() invocation from:
        -  _globre(), _regex() in match.py
        - remap() in subrepo.py

      - re.sub() invocation from remap() in subrepo.py

    re.compile()/escape()/sub() are invoked from many other places,
    so they can not be wrapped directly.

  (2) wrap tokenizer for parser._iter in parser.py to:

      - convert mbcs to unicode to avoid unexpected escaping by '\' in mbcs
      - convert token from unicode to local encoding, and
      - adjust parsed length in unicode to one in local encoding
(Continue reading)

hgbuildbot | 23 May 01:24

buildbot failure in Mercurial on OS X 10.6 hg tests

The Buildbot has detected a new failure on builder OS X 10.6 hg tests while building hg.
Full details are available at:
 http://hgbuildbot.kublai.com/builders/OS%20X%2010.6%20hg%20tests/builds/136

Buildbot URL: http://hgbuildbot.kublai.com/

Buildslave for this Build: sl

Build Reason: scheduler
Build Source Stamp: [branch default] 2ac08d8b21aa7b6e0a062afed5a3f357ccef67f9
Blamelist: Adrian Buehlmann <adrian <at> cadifra.com>,Augie Fackler <raf <at> durin42.com>,Dov Feldstern
<dfeldstern <at> gmail.com>,Elifarley Callado Coelho Cruz,Matt Mackall <mpm <at> selenic.com>,Patrick
Mezard <patrick <at> mezard.eu>,Paul Boddie <paul <at> boddie.org.uk>

BUILD FAILED: failed run-tests.py (python2.7) pure

sincerely,
 -The Buildbot

David Schleimer | 23 May 00:20

[PATCH v3] hg-ssh: read-only flag

# HG changeset patch
# User David Schleimer <dschleimer <at> fb.com>
# Date 1337725057 25200
# Node ID 186a9ebfa7b2b0c9b5be44efea601898efdbb473
# Parent  b52b7fe0dd08b257dfc69c8a5de503cec94f4b76
hg-ssh: read-only flag

Allows you to restrict a ssh key to have read-only access to a set of
repos by passing the --read-only flag to hg-ssh.

This is useful in an environment where the number of unix users you
can or are willing to create is limited.  In such an environment,
multiple users or applications will share a single unix account.  Some
of those applications will likely need read-only access to the
repository.  This change makes it possible to grant them such access
without requiring that they use a separate unix account.

diff --git a/contrib/hg-ssh b/contrib/hg-ssh
--- a/contrib/hg-ssh
+++ b/contrib/hg-ssh
@@ -24,6 +24,9 @@

 You can use pattern matching of your normal shell, e.g.:
 command="cd repos && hg-ssh user/thomas/* projects/{mercurial,foo}"
+
+You can also add a --read-only flag to allow read-only access to a key, e.g.:
+command="hg-ssh --read-only repos/*"
 """

 # enable importing on demand to reduce startup time
(Continue reading)


Gmane