changeset 16192:a4413624d014

merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 28 Feb 2012 21:17:53 -0600
parents af3e67354beb (current diff) 7c75924a6926 (diff)
children 0196c437ca9f
files hgext/mq.py mercurial/commands.py tests/test-check-code-hg.t tests/test-mq.t
diffstat 11 files changed, 75 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/common.py	Sun Feb 26 17:12:15 2012 +0100
+++ b/hgext/convert/common.py	Tue Feb 28 21:17:53 2012 -0600
@@ -385,8 +385,12 @@
                 raise
             return
         for i, line in enumerate(fp):
+            line = line.splitlines()[0].rstrip()
+            if not line:
+                # Ignore blank lines
+                continue
             try:
-                key, value = line.splitlines()[0].rstrip().rsplit(' ', 1)
+                key, value = line.rsplit(' ', 1)
             except ValueError:
                 raise util.Abort(
                     _('syntax error in %s(%d): key/value pair expected')
@@ -418,8 +422,12 @@
     try:
         fp = open(path, 'r')
         for i, line in enumerate(fp):
+            line = line.splitlines()[0].rstrip()
+            if not line:
+                # Ignore blank lines
+                continue
             try:
-                child, parents = line.splitlines()[0].rstrip().split(' ', 1)
+                child, parents = line.split(' ', 1)
                 parents = parents.replace(',', ' ').split()
             except ValueError:
                 raise util.Abort(_('syntax error in %s(%d): child parent1'
--- a/hgext/mq.py	Sun Feb 26 17:12:15 2012 +0100
+++ b/hgext/mq.py	Tue Feb 28 21:17:53 2012 -0600
@@ -1930,7 +1930,7 @@
     return 0
 
 @command("qapplied",
-         [('1', 'last', None, _('show only the last patch'))
+         [('1', 'last', None, _('show only the preceding applied patch'))
           ] + seriesopts,
          _('hg qapplied [-1] [-s] [PATCH]'))
 def applied(ui, repo, patch=None, **opts):
@@ -2225,7 +2225,7 @@
 
 @command("qprev", seriesopts, _('hg qprev [-s]'))
 def prev(ui, repo, **opts):
-    """print the name of the previous applied patch
+    """print the name of the preceding applied patch
 
     Returns 0 on success."""
     q = repo.mq
--- a/mercurial/bookmarks.py	Sun Feb 26 17:12:15 2012 +0100
+++ b/mercurial/bookmarks.py	Tue Feb 28 21:17:53 2012 -0600
@@ -126,6 +126,17 @@
         wlock.release()
     repo._bookmarkcurrent = mark
 
+def unsetcurrent(repo):
+    wlock = repo.wlock()
+    try:
+        util.unlink(repo.join('bookmarks.current'))
+        repo._bookmarkcurrent = None
+    except OSError, inst:
+        if inst.errno != errno.ENOENT:
+            raise
+    finally:
+        wlock.release()
+
 def updatecurrentbookmark(repo, oldnode, curbranch):
     try:
         return update(repo, oldnode, repo.branchtags()[curbranch])
--- a/mercurial/commands.py	Sun Feb 26 17:12:15 2012 +0100
+++ b/mercurial/commands.py	Tue Feb 28 21:17:53 2012 -0600
@@ -5720,7 +5720,7 @@
 
     # with no argument, we also move the current bookmark, if any
     movemarkfrom = None
-    if node is None or node == '':
+    if rev is None or node == '':
         movemarkfrom = repo['.'].node()
 
     # if we defined a bookmark, we have to remember the original bookmark name
@@ -5754,6 +5754,8 @@
             ui.status(_("updating bookmark %s\n") % repo._bookmarkcurrent)
     elif brev in repo._bookmarks:
         bookmarks.setcurrent(repo, brev)
+    elif brev:
+        bookmarks.unsetcurrent(repo)
 
     return ret
 
--- a/setup.py	Sun Feb 26 17:12:15 2012 +0100
+++ b/setup.py	Tue Feb 28 21:17:53 2012 -0600
@@ -452,10 +452,18 @@
 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
     # XCode 4.0 dropped support for ppc architecture, which is hardcoded in
     # distutils.sysconfig
-    version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()[0]
-    # Also parse only first digit, because 3.2.1 can't be parsed nicely
-    if (version.startswith('Xcode') and
-        StrictVersion(version.split()[1]) >= StrictVersion('4.0')):
+    version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines()
+    if version:
+        version = version.splitlines()[0]
+        xcode4 = (version.startswith('Xcode') and
+                  StrictVersion(version.split()[1]) >= StrictVersion('4.0'))
+    else:
+        # xcodebuild returns empty on OS X Lion with XCode 4.3 not
+        # installed, but instead with only command-line tools. Assume
+        # that only happens on >= Lion, thus no PPC support.
+        xcode4 = True
+
+    if xcode4:
         os.environ['ARCHFLAGS'] = ''
 
 setup(name='mercurial',
--- a/tests/test-bookmarks-current.t	Sun Feb 26 17:12:15 2012 +0100
+++ b/tests/test-bookmarks-current.t	Tue Feb 28 21:17:53 2012 -0600
@@ -125,3 +125,29 @@
   $ hg bookmarks
      X                         0:719295282060
      Z                         0:719295282060
+
+test deleting .hg/bookmarks.current when explicitly updating
+to a revision
+
+  $ echo a >> b
+  $ hg ci -m.
+  $ hg up -q X
+  $ test -f .hg/bookmarks.current
+
+try to update to it again to make sure we don't
+set and then unset it
+
+  $ hg up -q X
+  $ test -f .hg/bookmarks.current
+
+  $ hg up -q 1
+  $ test -f .hg/bookmarks.current
+  [1]
+
+when a bookmark is active, hg up -r . is
+analogus to hg book -i <active bookmark>
+
+  $ hg up -q X
+  $ hg up -q .
+  $ test -f .hg/bookmarks.current
+  [1]
--- a/tests/test-bookmarks-strip.t	Sun Feb 26 17:12:15 2012 +0100
+++ b/tests/test-bookmarks-strip.t	Tue Feb 28 21:17:53 2012 -0600
@@ -34,7 +34,7 @@
 
   $ hg book test2
 
-update to -2
+update to -2 (inactives the active bookmark)
 
   $ hg update -r -2
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -61,7 +61,7 @@
 
   $ hg book
      test                      1:8cf31af87a2b
-   * test2                     1:8cf31af87a2b
+     test2                     1:8cf31af87a2b
 
 immediate rollback and reentrancy issue
 
--- a/tests/test-check-code-hg.t	Sun Feb 26 17:12:15 2012 +0100
+++ b/tests/test-check-code-hg.t	Tue Feb 28 21:17:53 2012 -0600
@@ -1,6 +1,9 @@
   $ check_code="$TESTDIR"/../contrib/check-code.py
   $ cd "$TESTDIR"/..
-
+  $ if ! hg identify -q > /dev/null; then
+  >     echo "skipped: not a Mercurial working dir" >&2
+  >     exit 80
+  > fi
   $ hg manifest | xargs "$check_code" || echo 'FAILURE IS NOT AN OPTION!!!'
 
   $ hg manifest | xargs "$check_code" --warnings --nolineno --per-file=0 || true
--- a/tests/test-convert-splicemap.t	Sun Feb 26 17:12:15 2012 +0100
+++ b/tests/test-convert-splicemap.t	Tue Feb 28 21:17:53 2012 -0600
@@ -67,10 +67,12 @@
   $ cat > splicemap <<EOF
   > $CHILDID1 $PARENTID1
   > $CHILDID2 $PARENTID2,$CHILDID1
+  > 
   > EOF
   $ cat splicemap
   527cdedf31fbd5ea708aa14eeecf53d4676f38db 6d4c2037ddc2cb2627ac3a244ecce35283268f8e
   e4ea00df91897da3079a10fab658c1eddba6617b e55c719b85b60e5102fac26110ba626e7cb6b7dc,527cdedf31fbd5ea708aa14eeecf53d4676f38db
+  
   $ hg clone repo1 target1
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-convert-svn-branches.t	Sun Feb 26 17:12:15 2012 +0100
+++ b/tests/test-convert-svn-branches.t	Tue Feb 28 21:17:53 2012 -0600
@@ -14,6 +14,8 @@
 
   $ cat > branchmap <<EOF
   > old3 newbranch
+  >     
+  > 
   > EOF
   $ hg convert --branchmap=branchmap --datesort -r 10 svn-repo A-hg
   initializing destination A-hg repository
--- a/tests/test-mq.t	Sun Feb 26 17:12:15 2012 +0100
+++ b/tests/test-mq.t	Tue Feb 28 21:17:53 2012 -0600
@@ -74,7 +74,7 @@
    qnew          create a new patch
    qnext         print the name of the next pushable patch
    qpop          pop the current patch off the stack
-   qprev         print the name of the previous applied patch
+   qprev         print the name of the preceding applied patch
    qpush         push the next patch onto the stack
    qqueue        manage multiple patch queues
    qrefresh      update the current patch