merge with i18n stable stable
authorWagner Bruna <wbruna@softwareexpress.com.br>
Fri, 24 Sep 2010 19:26:01 -0300
branchstable
changeset 12563 b9ea2b7caffd
parent 12397 3b8ced3e3bbf (diff)
parent 12544 cf1df979956e (current diff)
child 12564 e55254f0920d
merge with i18n stable
--- a/doc/hgrc.5.txt	Tue Sep 21 01:51:56 2010 -0300
+++ b/doc/hgrc.5.txt	Fri Sep 24 19:26:01 2010 -0300
@@ -699,13 +699,12 @@
     Optional. Whether to connect to mail server using TLS. True or
     False. Default: False.
 ``username``
-    Optional. User name to authenticate to SMTP server with. If
-    username is specified, password must also be specified.
+    Optional. User name for authenticating with the SMTP server.
     Default: none.
 ``password``
-    Optional. Password to authenticate to SMTP server with. If
-    username is specified, password must also be specified.
-    Default: none.
+    Optional. Password for authenticating with the SMTP server. If not
+    specified, interactive sessions will prompt the user for a
+    password; non-interactive sessions will fail. Default: none.
 ``local_hostname``
     Optional. It's the hostname that the sender can use to identify
     itself to the MTA.
--- a/hgext/bookmarks.py	Tue Sep 21 01:51:56 2010 -0300
+++ b/hgext/bookmarks.py	Fri Sep 24 19:26:01 2010 -0300
@@ -224,6 +224,7 @@
             in the .hg/bookmarks file.
             Read the file and return a (name=>nodeid) dictionary
             '''
+            self._loadingbookmarks = True
             try:
                 bookmarks = {}
                 for line in self.opener('bookmarks'):
@@ -231,6 +232,7 @@
                     bookmarks[refspec] = super(bookmark_repo, self).lookup(sha)
             except:
                 pass
+            self._loadingbookmarks = False
             return bookmarks
 
         @util.propertycache
@@ -257,8 +259,9 @@
             return super(bookmark_repo, self).rollback(*args)
 
         def lookup(self, key):
-            if key in self._bookmarks:
-                key = self._bookmarks[key]
+            if not getattr(self, '_loadingbookmarks', False):
+                if key in self._bookmarks:
+                    key = self._bookmarks[key]
             return super(bookmark_repo, self).lookup(key)
 
         def _bookmarksupdate(self, parents, node):
@@ -357,7 +360,8 @@
         def _findtags(self):
             """Merge bookmarks with normal tags"""
             (tags, tagtypes) = super(bookmark_repo, self)._findtags()
-            tags.update(self._bookmarks)
+            if not getattr(self, '_loadingbookmarks', False):
+                tags.update(self._bookmarks)
             return (tags, tagtypes)
 
         if hasattr(repo, 'invalidate'):
--- a/hgext/convert/darcs.py	Tue Sep 21 01:51:56 2010 -0300
+++ b/hgext/convert/darcs.py	Fri Sep 24 19:26:01 2010 -0300
@@ -8,7 +8,7 @@
 from common import NoRepo, checktool, commandline, commit, converter_source
 from mercurial.i18n import _
 from mercurial import util
-import os, shutil, tempfile
+import os, shutil, tempfile, re
 
 # The naming drift of ElementTree is fun!
 
@@ -31,11 +31,8 @@
         converter_source.__init__(self, ui, path, rev=rev)
         commandline.__init__(self, ui, 'darcs')
 
-        # check for _darcs, ElementTree, _darcs/inventory so that we can
-        # easily skip test-convert-darcs if ElementTree is not around
-        if not os.path.exists(os.path.join(path, '_darcs', 'inventories')):
-            raise NoRepo(_("%s does not look like a darcs repository") % path)
-
+        # check for _darcs, ElementTree so that we can easily skip
+        # test-convert-darcs if ElementTree is not around
         if not os.path.exists(os.path.join(path, '_darcs')):
             raise NoRepo(_("%s does not look like a darcs repository") % path)
 
@@ -55,6 +52,15 @@
         self.parents = {}
         self.tags = {}
 
+        # Check darcs repository format
+        format = self.format()
+        if format:
+            if format in ('darcs-1.0', 'hashed'):
+                raise NoRepo(_("%s repository format is unsupported, "
+                               "please upgrade") % format)
+        else:
+            self.ui.warn(_('failed to detect repository format!'))
+
     def before(self):
         self.tmppath = tempfile.mkdtemp(
             prefix='convert-' + os.path.basename(self.path) + '-')
@@ -91,6 +97,15 @@
         self.checkexit(fp.close())
         return etree.getroot()
 
+    def format(self):
+        output, status = self.run('show', 'repo', no_files=True,
+                                  repodir=self.path)
+        self.checkexit(status)
+        m = re.search(r'^\s*Format:\s*(.*)$', output, re.MULTILINE)
+        if not m:
+            return None
+        return ','.join(sorted(f.strip() for f in m.group(1).split(',')))
+
     def manifest(self):
         man = []
         output, status = self.run('show', 'files', no_directories=True,
--- a/hgext/mq.py	Tue Sep 21 01:51:56 2010 -0300
+++ b/hgext/mq.py	Fri Sep 24 19:26:01 2010 -0300
@@ -2713,8 +2713,16 @@
                                               editor, extra)
 
         def push(self, remote, force=False, revs=None, newbranch=False):
-            if self.mq.applied and not force and not revs:
-                raise util.Abort(_('source has mq patches applied'))
+            if self.mq.applied and not force:
+                haspatches = True
+                if revs:
+                    # Assume applied patches have no non-patch descendants
+                    # and are not on remote already. If they appear in the
+                    # set of resolved 'revs', bail out.
+                    applied = set(e.node for e in self.mq.applied)
+                    haspatches = bool([n for n in revs if n in applied])
+                if haspatches:
+                    raise util.Abort(_('source has mq patches applied'))
             return super(mqrepo, self).push(remote, force, revs, newbranch)
 
         def _findtags(self):
--- a/mercurial/commands.py	Tue Sep 21 01:51:56 2010 -0300
+++ b/mercurial/commands.py	Fri Sep 24 19:26:01 2010 -0300
@@ -1569,7 +1569,7 @@
         reflags |= re.I
     try:
         regexp = re.compile(pattern, reflags)
-    except Exception, inst:
+    except re.error, inst:
         ui.warn(_("grep: invalid match pattern: %s\n") % inst)
         return 1
     sep, eol = ':', '\n'
@@ -2533,7 +2533,11 @@
 
         revmatchfn = None
         if opts.get('patch') or opts.get('stat'):
-            revmatchfn = cmdutil.match(repo, fns, default='path')
+            if opts.get('follow') or opts.get('follow_first'):
+                # note: this might be wrong when following through merges
+                revmatchfn = cmdutil.match(repo, fns, default='path')
+            else:
+                revmatchfn = matchfn
 
         displayer.show(ctx, copies=copies, matchfn=revmatchfn)
 
--- a/mercurial/context.py	Tue Sep 21 01:51:56 2010 -0300
+++ b/mercurial/context.py	Fri Sep 24 19:26:01 2010 -0300
@@ -843,7 +843,7 @@
                 if self._repo.dirstate[f] != 'r':
                     self._repo.ui.warn(_("%s not removed!\n") % f)
                 else:
-                    fctx = f in pctxs[0] and pctxs[0] or pctxs[1]
+                    fctx = f in pctxs[0] and pctxs[0][f] or pctxs[1][f]
                     t = fctx.data()
                     self._repo.wwrite(f, t, fctx.flags())
                     self._repo.dirstate.normal(f)
--- a/mercurial/url.py	Tue Sep 21 01:51:56 2010 -0300
+++ b/mercurial/url.py	Fri Sep 24 19:26:01 2010 -0300
@@ -469,9 +469,6 @@
         _generic_start_transaction(self, h, req)
         return keepalive.HTTPHandler._start_transaction(self, h, req)
 
-    def __del__(self):
-        self.close_all()
-
 if has_https:
     class BetterHTTPS(httplib.HTTPSConnection):
         send = keepalive.safesend
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/darcs/darcs1/_darcs/inventory	Fri Sep 24 19:26:01 2010 -0300
@@ -0,0 +1,2 @@
+[adda
+test@test.com**20100923184058] 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/darcs/darcs1/_darcs/prefs/author	Fri Sep 24 19:26:01 2010 -0300
@@ -0,0 +1,1 @@
+test@test.com
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/darcs/darcs1/_darcs/prefs/binaries	Fri Sep 24 19:26:01 2010 -0300
@@ -0,0 +1,59 @@
+# Binary file regexps:
+\.png$
+\.PNG$
+\.gz$
+\.GZ$
+\.pdf$
+\.PDF$
+\.jpg$
+\.JPG$
+\.jpeg$
+\.JPEG$
+\.gif$
+\.GIF$
+\.tif$
+\.TIF$
+\.tiff$
+\.TIFF$
+\.pnm$
+\.PNM$
+\.pbm$
+\.PBM$
+\.pgm$
+\.PGM$
+\.ppm$
+\.PPM$
+\.bmp$
+\.BMP$
+\.mng$
+\.MNG$
+\.tar$
+\.TAR$
+\.bz2$
+\.BZ2$
+\.z$
+\.Z$
+\.zip$
+\.ZIP$
+\.jar$
+\.JAR$
+\.so$
+\.SO$
+\.a$
+\.A$
+\.tgz$
+\.TGZ$
+\.mpg$
+\.MPG$
+\.mpeg$
+\.MPEG$
+\.iso$
+\.ISO$
+\.exe$
+\.EXE$
+\.doc$
+\.DOC$
+\.elc$
+\.ELC$
+\.pyc$
+\.PYC$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/darcs/darcs1/_darcs/prefs/boring	Fri Sep 24 19:26:01 2010 -0300
@@ -0,0 +1,49 @@
+# Boring file regexps:
+\.hi$
+\.hi-boot$
+\.o-boot$
+\.o$
+\.o\.cmd$
+# *.ko files aren't boring by default because they might
+# be Korean translations rather than kernel modules.
+# \.ko$
+\.ko\.cmd$
+\.mod\.c$
+(^|/)\.tmp_versions($|/)
+(^|/)CVS($|/)
+\.cvsignore$
+^\.#
+(^|/)RCS($|/)
+,v$
+(^|/)\.svn($|/)
+\.bzr$
+(^|/)SCCS($|/)
+~$
+(^|/)_darcs($|/)
+\.bak$
+\.BAK$
+\.orig$
+\.rej$
+(^|/)vssver\.scc$
+\.swp$
+(^|/)MT($|/)
+(^|/)\{arch\}($|/)
+(^|/).arch-ids($|/)
+(^|/),
+\.prof$
+(^|/)\.DS_Store$
+(^|/)BitKeeper($|/)
+(^|/)ChangeSet($|/)
+\.py[co]$
+\.elc$
+\.class$
+\#
+(^|/)Thumbs\.db$
+(^|/)autom4te\.cache($|/)
+(^|/)config\.(log|status)$
+^\.depend$
+(^|/)(tags|TAGS)$
+#(^|/)\.[^/]
+(^|/|\.)core$
+\.(obj|a|exe|so|lo|la)$
+^\.darcs-temp-mail$
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/darcs/darcs1/_darcs/pristine/a	Fri Sep 24 19:26:01 2010 -0300
@@ -0,0 +1,1 @@
+a 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/darcs/darcs1/a	Fri Sep 24 19:26:01 2010 -0300
@@ -0,0 +1,1 @@
+a 
--- a/tests/test-archive	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-archive	Fri Sep 24 19:26:01 2010 -0300
@@ -141,10 +141,10 @@
 hg archive ../test-empty
 
 echo '% old file -- date clamped to 1980'
-touch -d 1975-01-01 old
+touch -t 197501010000 old
 hg add old
 hg commit -m old
 hg archive ../old.zip
-unzip -l ../old.zip
+unzip -l ../old.zip | grep 80 > /dev/null && echo ok
 
 exit 0
--- a/tests/test-archive.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-archive.out	Fri Sep 24 19:26:01 2010 -0300
@@ -81,10 +81,4 @@
 % empty repo
 abort: no working directory: please specify a revision
 % old file -- date clamped to 1980
-Archive:  ../old.zip
-  Length      Date    Time    Name
----------  ---------- -----   ----
-      147  1980-01-01 00:00   old/.hg_archival.txt
-        0  1980-01-01 00:00   old/old
----------                     -------
-      147                     2 files
+ok
--- a/tests/test-bookmarks-strip	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-bookmarks-strip	Fri Sep 24 19:26:01 2010 -0300
@@ -43,3 +43,18 @@
 echo % list bookmarks
 hg book
 
+echo '% test immediate rollback and reentrancy issue'
+echo "mq=!" >> $HGRCPATH
+hg init repo
+cd repo
+echo a > a
+hg ci -Am adda
+echo b > b
+hg ci -Am addb
+hg bookmarks markb
+hg rollback
+hg bookmarks
+hg bookmarks markb
+hg bookmarks
+cd ..
+
--- a/tests/test-bookmarks-strip.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-bookmarks-strip.out	Fri Sep 24 19:26:01 2010 -0300
@@ -16,3 +16,9 @@
 % list bookmarks
  * test                      1:9f1b7e78eff8
  * test2                     1:9f1b7e78eff8
+% test immediate rollback and reentrancy issue
+adding a
+adding b
+rolling back to revision 0 (undo commit)
+no bookmarks set
+ * markb                     0:07f494440405
--- a/tests/test-convert-darcs	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-convert-darcs	Fri Sep 24 19:26:01 2010 -0300
@@ -17,6 +17,9 @@
     exit 80
 fi
 
+echo '% try converting darcs1 repository'
+hg convert -s darcs "$TESTDIR/darcs/darcs1" 2>&1 | grep darcs-1.0
+
 echo % initialize darcs repo
 mkdir darcs-repo
 cd darcs-repo
--- a/tests/test-convert-darcs.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-convert-darcs.out	Fri Sep 24 19:26:01 2010 -0300
@@ -1,3 +1,5 @@
+% try converting darcs1 repository
+darcs-1.0 repository format is unsupported, please upgrade
 % initialize darcs repo
 Finished recording patch 'p0'
 % branch and update
--- a/tests/test-gendoc	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-gendoc	Fri Sep 24 19:26:01 2010 -0300
@@ -11,7 +11,7 @@
     echo "% extracting documentation from $LOCALE"
     echo ".. -*- coding: utf-8 -*-" > gendoc-$LOCALE.txt
     echo "" >> gendoc-$LOCALE.txt
-    LC_ALL=$LOCALE python $TESTDIR/../doc/gendoc.py >> gendoc-$LOCALE.txt || exit
+    LC_ALL=$LOCALE python $TESTDIR/../doc/gendoc.py >> gendoc-$LOCALE.txt 2> /dev/null || exit
 
     # We call runrst without adding "--halt warning" to make it report
     # all errors instead of stopping on the first one.
--- a/tests/test-hgweb.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-hgweb.out	Fri Sep 24 19:26:01 2010 -0300
@@ -276,6 +276,7 @@
 tr.dark, .parity1 { background-color:#f6f6f0; }
 tr.dark:hover, .parity1:hover { background-color:#edece6; }
 td { padding:2px 5px; font-size:12px; vertical-align:top; }
+td.closed { background-color: #99f; }
 td.link { padding:2px 5px; font-family:sans-serif; font-size:10px; }
 td.indexlinks { white-space: nowrap; }
 td.indexlinks a {
--- a/tests/test-log	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-log	Fri Sep 24 19:26:01 2010 -0300
@@ -194,5 +194,26 @@
 cd dir
 hg log -p -R .. ../a
 
+cd ..
 
-exit 0
+echo '% issue2383'
+
+hg init issue2383
+cd issue2383
+echo a > a
+hg ci -Am0
+echo b > b
+hg ci -Am1
+hg co 0
+echo b > a
+hg ci -m2
+hg merge
+echo c > a
+hg ci -m3
+echo
+echo % diff
+hg diff --rev 2:3
+echo
+echo % log
+hg log -vpr 3
+cd ..
--- a/tests/test-log.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-log.out	Fri Sep 24 19:26:01 2010 -0300
@@ -585,3 +585,48 @@
 @@ -0,0 +1,1 @@
 +a
 
+% issue2383
+adding a
+adding b
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+created new head
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+
+% diff
+diff -r b09be438c43a -r 8e07aafe1edc a
+--- a/a	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:00 1970 +0000
+@@ -1,1 +1,1 @@
+-b
++c
+diff -r b09be438c43a -r 8e07aafe1edc b
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/b	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++b
+
+% log
+changeset:   3:8e07aafe1edc
+tag:         tip
+parent:      2:b09be438c43a
+parent:      1:925d80f479bb
+user:        test
+date:        Thu Jan 01 00:00:00 1970 +0000
+files:       a
+description:
+3
+
+
+diff -r b09be438c43a -r 8e07aafe1edc a
+--- a/a	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:00 1970 +0000
+@@ -1,1 +1,1 @@
+-b
++c
+diff -r b09be438c43a -r 8e07aafe1edc b
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/b	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++b
+
--- a/tests/test-mq-qrename	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-mq-qrename	Fri Sep 24 19:26:01 2010 -0300
@@ -36,4 +36,18 @@
 hg qcommit -m rename
 cd ..
 
-
+echo '% test overlapping renames (issue2388)'
+hg init c
+cd c
+hg qinit -c
+echo a > a
+hg add
+hg qnew patcha
+echo b > b
+hg add
+hg qnew patchb
+hg ci --mq -m c1
+hg qrename patchb patchc
+hg qrename patcha patchb
+hg st --mq
+cd ..
\ No newline at end of file
--- a/tests/test-mq-qrename.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-mq-qrename.out	Fri Sep 24 19:26:01 2010 -0300
@@ -8,3 +8,10 @@
 new/dir
 .hg/patches/new/dir
 % test patch being renamed before committed
+% test overlapping renames (issue2388)
+adding a
+adding b
+M patchb
+M series
+A patchc
+R patcha
--- a/tests/test-mq-safety	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-mq-safety	Fri Sep 24 19:26:01 2010 -0300
@@ -62,3 +62,29 @@
 hg up default
 hg log
 hg qpush
+cd ..
+
+echo '% testing applied patches, push and --force'
+hg init forcepush
+cd forcepush
+echo a > a
+hg ci -Am adda
+echo a >> a
+hg ci -m changea
+hg up 0
+hg branch branch
+echo b > b
+hg ci -Am addb
+hg up 0
+hg --cwd .. clone -r 0 forcepush forcepush2
+echo a >> a
+hg qnew patch
+echo '% pushing applied patch with --rev without --force'
+hg push -r default ../forcepush2
+echo '% pushing applied patch with branchhash, without --force'
+hg push ../forcepush2#default
+echo '% pushing revs excluding applied patch'
+hg push --new-branch -r branch -r 2 ../forcepush2
+echo '% pushing applied patch with --force'
+hg push --force -r default ../forcepush2
+cd ..
--- a/tests/test-mq-safety.out	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-mq-safety.out	Fri Sep 24 19:26:01 2010 -0300
@@ -45,3 +45,36 @@
 
 applying qp
 now at: qp
+% testing applied patches, push and --force
+adding a
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+marked working directory as branch branch
+adding b
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+updating to branch default
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% pushing applied patch with --rev without --force
+pushing to ../forcepush2
+abort: source has mq patches applied
+% pushing applied patch with branchhash, without --force
+pushing to ../forcepush2
+abort: source has mq patches applied
+% pushing revs excluding applied patch
+pushing to ../forcepush2
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+% pushing applied patch with --force
+pushing to ../forcepush2
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files (+1 heads)
--- a/tests/test-mq-symlinks	Tue Sep 21 01:51:56 2010 -0300
+++ b/tests/test-mq-symlinks	Fri Sep 24 19:26:01 2010 -0300
@@ -61,6 +61,7 @@
 hg add linka
 hg qnew link
 hg mv linka linkb
+rm linkb
 ln -sf linkb linkb
 hg qnew movelink
 hg qpop
@@ -71,4 +72,4 @@
 ln -s linkbb linkb
 hg qpush
 
-true
\ No newline at end of file
+true