changeset 5677:4f977c6d3c03

Merge with mpm
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 19 Dec 2007 19:23:18 -0800
parents 9ed6575897f7 (current diff) 9d6ad26fab10 (diff)
children d3909674fcea
files hgext/patchbomb.py
diffstat 20 files changed, 366 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgk	Wed Dec 19 19:21:30 2007 -0800
+++ b/contrib/hgk	Wed Dec 19 19:23:18 2007 -0800
@@ -3844,7 +3844,7 @@
 
 set colors {green red blue magenta darkgrey brown orange}
 set authorcolors {
-    deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey
+    black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey
 }
 
 catch {source ~/.hgk}
--- a/contrib/macosx/Readme.html	Wed Dec 19 19:21:30 2007 -0800
+++ b/contrib/macosx/Readme.html	Wed Dec 19 19:23:18 2007 -0800
@@ -17,20 +17,11 @@
 <body>
 <p class="p1"><b>Before you install</b></p>
 <p class="p2"><br></p>
-<p class="p3">This is <i>not</i> a stand-alone version of Mercurial.</p>
-<p class="p2"><br></p>
-<p class="p3">To use it, you must have the appropriate version of Universal MacPython from <a href="http://www.python.org">www.python.org</a> installed.</p>
-<p class="p2"><br></p>
-<p class="p3">You can find more information and download MacPython from here:</p>
-<p class="p4"><span class="s1"><a href="http://www.python.org/download">http://www.python.org/download</a></span></p>
-<p class="p2"><br></p>
-<p class="p3">Or direct links to the latest version are:</p>
-<p class="p4"><span class="s1"><a href="http://www.python.org/ftp/python/2.5.1/python-2.5.1-macosx.dmg">Python 2.5.1 for Macintosh OS X</a></span></p>
-<p class="p4"><span class="s1"><a href="http://www.python.org/ftp/python/2.4.4/python-2.4.4-macosx2006-10-18.dmg">Python 2.4.4 for Macintosh OS X</a></span></p>
+<p class="p3">This is an OS X 10.5 version of Mercurial that depends on the default Python 2.5 installation.</p>
 <p class="p2"><br></p>
 <p class="p1"><b>After you install</b></p>
 <p class="p2"><br></p>
-<p class="p3">This package installs the <span class="s2">hg</span> executable in <span class="s2">/Library/Frameworks/Python.framework/Versions/Current/bin</span>. This directory may not be in your shell's search path. The MacPython installer will have created an entry in <span class="s2">.profile</span> for it but if your shell doesn't use <span class="s2">.profile</span> you'll need configure it yourself or create a symlink from a directory already in your path.</p>
+<p class="p3">This package installs the <span class="s2">hg</span> executable in <span class="s2">/usr/local/bin</span> and the Mercurial files in </span class="s2">/Library/Python/2.5/site-packages/mercurial.</span></p>
 <p class="p2"><br></p>
 <p class="p1"><b>Documentation</b></p>
 <p class="p2"><br></p>
--- a/doc/hg.1.txt	Wed Dec 19 19:21:30 2007 -0800
+++ b/doc/hg.1.txt	Wed Dec 19 19:23:18 2007 -0800
@@ -89,8 +89,6 @@
     A range acts as a closed interval.  This means that a range of 3:5
     gives 3, 4 and 5.  Similarly, a range of 4:2 gives 4, 3, and 2.
 
-dot=.
-
 FILES
 -----
  repo/.hgignore::
--- a/hgext/convert/convcmd.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/hgext/convert/convcmd.py	Wed Dec 19 19:23:18 2007 -0800
@@ -145,7 +145,8 @@
                 if pl:
                     depth[n] = max([depth[p] for p in pl]) + 1
 
-            s = [(depth[n], self.commitcache[n].date, n) for n in s]
+            s = [(depth[n], util.parsedate(self.commitcache[n].date), n)
+                 for n in s]
             s.sort()
             s = [e[2] for e in s]
 
--- a/hgext/highlight.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/hgext/highlight.py	Wed Dec 19 19:23:18 2007 -0800
@@ -66,20 +66,22 @@
         yield 0, "</div>"
 
 
-def pygments_format(filename, rawtext, forcetext=False, stripecount=1,
-                    style='colorful'):
+def pygments_format(filename, rawtext, forcetext, encoding,
+                    stripecount, style):
+    etext = util.tolocal(rawtext)
     if not forcetext:
         try:
-            lexer = guess_lexer_for_filename(filename, rawtext)
+            lexer = guess_lexer_for_filename(filename, etext,
+                                             encoding=util._encoding)
         except ClassNotFound:
-            lexer = TextLexer()
+            lexer = TextLexer(encoding=util._encoding)
     else:
-        lexer = TextLexer()
+        lexer = TextLexer(encoding=util._encoding)
 
     formatter = StripedHtmlFormatter(stripecount, style=style,
-                                     linenos='inline')
+                                     linenos='inline', encoding=encoding)
 
-    return highlight(rawtext, lexer, formatter)
+    return highlight(etext, lexer, formatter)
 
 
 def filerevision_pygments(self, tmpl, fctx):
@@ -110,10 +112,8 @@
 
     style = self.config("web", "pygments_style", "colorful")
 
-    text_formatted = lines(pygments_format(f, text,
-                                           forcetext=forcetext,
-                                           stripecount=self.stripecount,
-                                           style=style))
+    text_formatted = lines(pygments_format(f, text, forcetext, self.encoding,
+                                           self.stripecount, style))
 
     # override per-line template
     tmpl.cache['fileline'] = '#line#'
--- a/hgmerge	Wed Dec 19 19:21:30 2007 -0800
+++ b/hgmerge	Wed Dec 19 19:23:18 2007 -0800
@@ -17,8 +17,12 @@
 BASE="$2"
 OTHER="$3"
 
-if [ -z "$EDITOR" ]; then
-    EDITOR="vi"
+if [ -n "$VISUAL" ]; then
+    EDIT_PROG="$VISUAL"
+elif [ -n "$EDITOR" ]; then
+    EDIT_PROG="$EDITOR"
+else
+    EDIT_PROG="vi"
 fi
 
 # find decent versions of our utilities, insisting on the GNU versions where we
@@ -165,16 +169,16 @@
     fi
 fi
 
-# Attempt to do a merge with $EDITOR
+# Attempt to do a merge with $EDIT_PROG
 if [ -n "$MERGE" -o -n "$DIFF3" ]; then
     echo "conflicts detected in $LOCAL"
     cp "$BACKUP" "$CHGTEST"
-    case "$EDITOR" in
+    case "$EDIT_PROG" in
         "emacs")
-            $EDITOR "$LOCAL" --eval '(condition-case nil (smerge-mode 1) (error nil))' || failure
+            $EDIT_PROG "$LOCAL" --eval '(condition-case nil (smerge-mode 1) (error nil))' || failure
             ;;
         *)
-            $EDITOR "$LOCAL" || failure
+            $EDIT_PROG "$LOCAL" || failure
             ;;
     esac
     # Some editors do not return meaningful error codes
@@ -195,7 +199,7 @@
         success
     else
         # If rejects are empty after using the editor, merge was ok
-        $EDITOR "$LOCAL" "$LOCAL.rej" || failure
+        $EDIT_PROG "$LOCAL" "$LOCAL.rej" || failure
         $TEST -s "$LOCAL.rej" || success
     fi
     failure
--- a/mercurial/bundlerepo.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/bundlerepo.py	Wed Dec 19 19:23:18 2007 -0800
@@ -256,14 +256,25 @@
 def instance(ui, path, create):
     if create:
         raise util.Abort(_('cannot create new bundle repository'))
+    parentpath = ui.config("bundle", "mainreporoot", "")
+    if parentpath:
+        # Try to make the full path relative so we get a nice, short URL.
+        # In particular, we don't want temp dir names in test outputs.
+        cwd = os.getcwd()
+        if parentpath == cwd:
+            parentpath = ''
+        else:
+            cwd = os.path.join(cwd,'')
+            if parentpath.startswith(cwd):
+                parentpath = parentpath[len(cwd):]
     path = util.drop_scheme('file', path)
     if path.startswith('bundle:'):
         path = util.drop_scheme('bundle', path)
         s = path.split("+", 1)
         if len(s) == 1:
-            repopath, bundlename = "", s[0]
+            repopath, bundlename = parentpath, s[0]
         else:
             repopath, bundlename = s
     else:
-        repopath, bundlename = '', path
+        repopath, bundlename = parentpath, path
     return bundlerepository(ui, repopath, bundlename)
--- a/mercurial/commands.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/commands.py	Wed Dec 19 19:23:18 2007 -0800
@@ -430,8 +430,8 @@
     If a list of files is omitted, all changes reported by "hg status"
     will be committed.
 
-    If no commit message is specified, the editor configured in your hgrc
-    or in the EDITOR environment variable is started to enter a message.
+    If no commit message is specified, the configured editor is started to
+    enter a message.
     """
     def commitfunc(ui, repo, files, message, match, opts):
         return repo.commit(files, message, opts['user'], opts['date'], match,
@@ -748,9 +748,7 @@
 
     # editor
     ui.status(_("Checking commit editor...\n"))
-    editor = (os.environ.get("HGEDITOR") or
-              ui.config("ui", "editor") or
-              os.environ.get("EDITOR", "vi"))
+    editor = ui.geteditor()
     cmdpath = util.find_exe(editor) or util.find_exe(editor.split()[0])
     if not cmdpath:
         if editor == 'vi':
@@ -2428,8 +2426,15 @@
         rev_ = opts['rev']
     message = opts['message']
     if opts['remove']:
-        if not name in repo.tags():
+        tagtype = repo.tagtype(name)
+
+        if not tagtype:
             raise util.Abort(_('tag %s does not exist') % name)
+        if opts['local'] and tagtype == 'global':
+           raise util.Abort(_('%s tag is global') % name)
+        if not opts['local'] and tagtype == 'local':
+           raise util.Abort(_('%s tag is local') % name)
+
         rev_ = nullid
         if not message:
             message = _('Removed tag %s') % name
@@ -2451,23 +2456,33 @@
 
     List the repository tags.
 
-    This lists both regular and local tags.
+    This lists both regular and local tags. When the -v/--verbose switch
+    is used, a third column "local" is printed for local tags.
     """
 
     l = repo.tagslist()
     l.reverse()
     hexfunc = ui.debugflag and hex or short
+    tagtype = ""
+
     for t, n in l:
+        if ui.quiet:
+            ui.write("%s\n" % t)
+            continue
+
         try:
             hn = hexfunc(n)
-            r = "%5d:%s" % (repo.changelog.rev(n), hexfunc(n))
+            r = "%5d:%s" % (repo.changelog.rev(n), hn)
         except revlog.LookupError:
             r = "    ?:%s" % hn
-        if ui.quiet:
-            ui.write("%s\n" % t)
         else:
             spaces = " " * (30 - util.locallen(t))
-            ui.write("%s%s %s\n" % (t, spaces, r))
+            if ui.verbose:
+                if repo.tagtype(t) == 'local':
+                    tagtype = " local"
+                else:
+                    tagtype = ""
+            ui.write("%s%s %s%s\n" % (t, spaces, r, tagtype))
 
 def tip(ui, repo, **opts):
     """show the tip revision
--- a/mercurial/dispatch.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/dispatch.py	Wed Dec 19 19:23:18 2007 -0800
@@ -331,6 +331,7 @@
         try:
             repo = hg.repository(ui, path=path)
             ui = repo.ui
+            ui.setconfig("bundle", "mainreporoot", repo.root)
             if not repo.local():
                 raise util.Abort(_("repository '%s' is not local") % path)
         except hg.RepoError:
--- a/mercurial/help.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/help.py	Wed Dec 19 19:23:18 2007 -0800
@@ -43,8 +43,7 @@
     'hg' (with com/exe/bat/cmd extension on Windows) is searched.
 
 HGEDITOR::
-    This is the name of the editor to use when committing. Defaults to the
-    value of EDITOR.
+    This is the name of the editor to use when committing. See EDITOR.
 
     (deprecated, use .hgrc)
 
@@ -94,9 +93,16 @@
     If neither HGUSER nor EMAIL is set, LOGNAME will be used (with
     '@hostname' appended) as the author value for a commit.
 
+VISUAL::
+    This is the name of the editor to use when committing. See EDITOR.
+
 EDITOR::
-    This is the name of the editor used in the hgmerge script. It will be
-    used for commit messages if HGEDITOR isn't set. Defaults to 'vi'.
+    Sometimes Mercurial needs to open a text file in an editor for a user
+    to modify, for example when writing commit messages or when using the
+    hgmerge script. The editor it uses is determined by looking at the
+    environment variables HGEDITOR, VISUAL and EDITOR, in that order. The
+    first non-empty one is chosen. If all of them are empty, the editor
+    defaults to 'vi'.
 
 PYTHONPATH::
     This is used by Python to find imported modules and may need to be set
--- a/mercurial/localrepo.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/localrepo.py	Wed Dec 19 19:23:18 2007 -0800
@@ -79,6 +79,7 @@
             pass
 
         self.tagscache = None
+        self._tagstypecache = None
         self.branchcache = None
         self.nodetagscache = None
         self.filterpats = {}
@@ -198,8 +199,9 @@
             return self.tagscache
 
         globaltags = {}
+        tagtypes = {}
 
-        def readtags(lines, fn):
+        def readtags(lines, fn, tagtype):
             filetags = {}
             count = 0
 
@@ -234,7 +236,9 @@
             for k, nh in filetags.items():
                 if k not in globaltags:
                     globaltags[k] = nh
+                    tagtypes[k] = tagtype
                     continue
+
                 # we prefer the global tag if:
                 #  it supercedes us OR
                 #  mutual supercedes and it has a higher rank
@@ -246,31 +250,47 @@
                     an = bn
                 ah.extend([n for n in bh if n not in ah])
                 globaltags[k] = an, ah
+                tagtypes[k] = tagtype
 
         # read the tags file from each head, ending with the tip
         f = None
         for rev, node, fnode in self._hgtagsnodes():
             f = (f and f.filectx(fnode) or
                  self.filectx('.hgtags', fileid=fnode))
-            readtags(f.data().splitlines(), f)
+            readtags(f.data().splitlines(), f, "global")
 
         try:
             data = util.fromlocal(self.opener("localtags").read())
             # localtags are stored in the local character set
             # while the internal tag table is stored in UTF-8
-            readtags(data.splitlines(), "localtags")
+            readtags(data.splitlines(), "localtags", "local")
         except IOError:
             pass
 
         self.tagscache = {}
+        self._tagstypecache = {}
         for k,nh in globaltags.items():
             n = nh[0]
             if n != nullid:
                 self.tagscache[k] = n
+                self._tagstypecache[k] = tagtypes[k]
         self.tagscache['tip'] = self.changelog.tip()
 
         return self.tagscache
 
+    def tagtype(self, tagname):
+        '''
+        return the type of the given tag. result can be:
+
+        'local'  : a local tag
+        'global' : a global tag
+        None     : tag does not exist
+        '''
+
+        self.tags()
+ 
+        return self._tagstypecache.get(tagname)
+
     def _hgtagsnodes(self):
         heads = self.heads()
         heads.reverse()
@@ -553,6 +573,7 @@
             if hasattr(self, a):
                 self.__delattr__(a)
         self.tagscache = None
+        self._tagstypecache = None
         self.nodetagscache = None
 
     def _lock(self, lockname, wait, releasefn, acquirefn, desc):
@@ -1716,7 +1737,7 @@
             for fname in changedfiles:
                 filerevlog = self.file(fname)
                 if filerevlog.count() == 0:
-                    raise util.abort(_("empty or missing revlog for %s") % fname)
+                    raise util.Abort(_("empty or missing revlog for %s") % fname)
                 # Toss out the filenodes that the recipient isn't really
                 # missing.
                 if msng_filenode_set.has_key(fname):
@@ -1802,7 +1823,7 @@
             for fname in changedfiles:
                 filerevlog = self.file(fname)
                 if filerevlog.count() == 0:
-                    raise util.abort(_("empty or missing revlog for %s") % fname)
+                    raise util.Abort(_("empty or missing revlog for %s") % fname)
                 nodeiter = gennodelst(filerevlog)
                 nodeiter = list(nodeiter)
                 if nodeiter:
--- a/mercurial/revlog.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/revlog.py	Wed Dec 19 19:23:18 2007 -0800
@@ -112,8 +112,6 @@
     # lazyparser is not safe to use on windows if win32 extensions not
     # available. it keeps file handle open, which make it not possible
     # to break hardlinks on local cloned repos.
-    safe_to_use = os.name != 'nt' or (not util.is_win_9x() and
-                                      hasattr(util, 'win32api'))
 
     def __init__(self, dataf, size):
         self.dataf = dataf
@@ -362,7 +360,7 @@
         except AttributeError:
             size = 0
 
-        if lazyparser.safe_to_use and not inline and size > 1000000:
+        if util.openhardlinks() and not inline and size > 1000000:
             # big index, let's parse it on demand
             parser = lazyparser(fp, size)
             index = lazyindex(parser)
--- a/mercurial/ui.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/ui.py	Wed Dec 19 19:23:18 2007 -0800
@@ -440,9 +440,7 @@
             f.write(text)
             f.close()
 
-            editor = (os.environ.get("HGEDITOR") or
-                    self.config("ui", "editor") or
-                    os.environ.get("EDITOR", "vi"))
+            editor = self.geteditor()
 
             util.system("%s \"%s\"" % (editor, name),
                         environ={'HGUSER': user},
@@ -464,3 +462,11 @@
         if self.traceback:
             traceback.print_exc()
         return self.traceback
+
+    def geteditor(self):
+        '''return editor to use'''
+        return (os.environ.get("HGEDITOR") or
+                self.config("ui", "editor") or
+                os.environ.get("VISUAL") or
+                os.environ.get("EDITOR", "vi"))
+
--- a/mercurial/util.py	Wed Dec 19 19:21:30 2007 -0800
+++ b/mercurial/util.py	Wed Dec 19 19:23:18 2007 -0800
@@ -772,12 +772,9 @@
 
 posixfile = file
 
-def is_win_9x():
-    '''return true if run on windows 95, 98 or me.'''
-    try:
-        return sys.getwindowsversion()[3] == 1
-    except AttributeError:
-        return os.name == 'nt' and 'command' in os.environ.get('comspec', '')
+def openhardlinks():
+    '''return true if it is safe to hold open file handles to hardlinks'''
+    return True
 
 getuser_fallback = None
 
@@ -943,6 +940,16 @@
 
     sys.stdout = winstdout(sys.stdout)
 
+    def _is_win_9x():
+        '''return true if run on windows 95, 98 or me.'''
+        try:
+            return sys.getwindowsversion()[3] == 1
+        except AttributeError:
+            return 'command' in os.environ.get('comspec', '')
+
+    def openhardlinks():
+        return not _is_win_9x and "win32api" in locals()
+
     def system_rcpath():
         try:
             return system_rcpath_win32()
@@ -1074,7 +1081,7 @@
     try:
         # override functions with win32 versions if possible
         from util_win32 import *
-        if not is_win_9x():
+        if not _is_win_9x():
             posixfile = posixfile_nt
     except ImportError:
         pass
--- a/tests/test-bundle	Wed Dec 19 19:21:30 2007 -0800
+++ b/tests/test-bundle	Wed Dec 19 19:23:18 2007 -0800
@@ -2,6 +2,7 @@
 
 cp "$TESTDIR"/printenv.py .
 
+echo "====== Setting up test"
 hg init test
 cd test
 echo 0 > afile
@@ -30,20 +31,40 @@
 hg verify
 cd ..
 hg init empty
+
+echo "====== Bundle test to full.hg"
 hg -R test bundle full.hg empty
+echo "====== Unbundle full.hg in test"
 hg -R test unbundle full.hg
+echo "====== Verify empty"
 hg -R empty heads
 hg -R empty verify
 
+echo "====== Pull full.hg into test (using --cwd)"
 hg --cwd test pull ../full.hg
+echo "====== Pull full.hg into empty (using --cwd)"
 hg --cwd empty pull ../full.hg
+echo "====== Rollback empty"
 hg -R empty rollback
+echo "====== Pull full.hg into empty again (using --cwd)"
 hg --cwd empty pull ../full.hg
 
+echo "====== Pull full.hg into test (using -R)"
+hg -R test pull full.hg
+echo "====== Pull full.hg into empty (using -R)"
+hg -R empty pull full.hg
+echo "====== Rollback empty"
+hg -R empty rollback
+echo "====== Pull full.hg into empty again (using -R)"
+hg -R empty pull full.hg
+
+echo "====== Log -R full.hg in fresh empty"
 rm -r empty
 hg init empty
 cd empty
 hg -R bundle://../full.hg log
+
+echo "====== Pull ../full.hg into empty (with hook)"
 echo '[hooks]' >> .hg/hgrc
 echo 'changegroup = python ../printenv.py changegroup' >> .hg/hgrc
 #doesn't work (yet ?)
@@ -51,18 +72,24 @@
 hg pull bundle://../full.hg
 cd ..
 
+echo "====== Create partial clones"
 rm -r empty
 hg init empty
 hg clone -r 3 test partial
 hg clone partial partial2
 cd partial
+echo "====== Log -R full.hg in partial"
 hg -R bundle://../full.hg log
+echo "====== Incoming full.hg in partial"
 hg incoming bundle://../full.hg
+echo "====== Outgoing -R full.hg vs partial2 in partial"
 hg -R bundle://../full.hg outgoing ../partial2
+echo "====== Outgoing -R does-not-exist.hg vs partial2 in partial"
 hg -R bundle://../does-not-exist.hg outgoing ../partial2
 cd ..
 
 # test for http://www.selenic.com/mercurial/bts/issue216
+echo "====== Unbundle incremental bundles into fresh empty in one go"
 rm -r empty
 hg init empty
 hg -R test bundle --base null -r 0 ../0.hg
@@ -70,6 +97,7 @@
 hg -R empty unbundle -u ../0.hg ../1.hg
 
 # test for 540d1059c802
+echo "====== test for 540d1059c802"
 hg init orig
 cd orig
 echo foo > foo
--- a/tests/test-bundle.out	Wed Dec 19 19:21:30 2007 -0800
+++ b/tests/test-bundle.out	Wed Dec 19 19:23:18 2007 -0800
@@ -1,3 +1,4 @@
+====== Setting up test
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
 checking changesets
@@ -5,12 +6,15 @@
 crosschecking files in changesets and manifests
 checking files
 4 files, 9 changesets, 7 total revisions
+====== Bundle test to full.hg
 searching for changes
+====== Unbundle full.hg in test
 adding changesets
 adding manifests
 adding file changes
 added 0 changesets with 0 changes to 4 files
 (run 'hg update' to get a working copy)
+====== Verify empty
 changeset:   -1:000000000000
 tag:         tip
 user:        
@@ -21,9 +25,11 @@
 crosschecking files in changesets and manifests
 checking files
 0 files, 0 changesets, 0 total revisions
+====== Pull full.hg into test (using --cwd)
 pulling from ../full.hg
 searching for changes
 no changes found
+====== Pull full.hg into empty (using --cwd)
 pulling from ../full.hg
 requesting all changes
 adding changesets
@@ -31,7 +37,9 @@
 adding file changes
 added 9 changesets with 7 changes to 4 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
+====== Rollback empty
 rolling back last transaction
+====== Pull full.hg into empty again (using --cwd)
 pulling from ../full.hg
 requesting all changes
 adding changesets
@@ -39,6 +47,25 @@
 adding file changes
 added 9 changesets with 7 changes to 4 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
+====== Pull full.hg into test (using -R)
+pulling from full.hg
+searching for changes
+no changes found
+====== Pull full.hg into empty (using -R)
+pulling from full.hg
+searching for changes
+no changes found
+====== Rollback empty
+rolling back last transaction
+====== Pull full.hg into empty again (using -R)
+pulling from full.hg
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 9 changesets with 7 changes to 4 files (+1 heads)
+(run 'hg heads' to see heads, 'hg merge' to merge)
+====== Log -R full.hg in fresh empty
 changeset:   8:836ac62537ab
 tag:         tip
 parent:      3:ac69c658229d
@@ -87,6 +114,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     0.0
 
+====== Pull ../full.hg into empty (with hook)
 changegroup hook: HG_NODE=5649c9d34dd87d0ecb5fd39672128376e83b22e1 HG_SOURCE=pull HG_URL=bundle:../full.hg 
 pulling from bundle://../full.hg
 requesting all changes
@@ -95,6 +123,7 @@
 adding file changes
 added 9 changesets with 7 changes to 4 files (+1 heads)
 (run 'hg heads' to see heads, 'hg merge' to merge)
+====== Create partial clones
 requesting all changes
 adding changesets
 adding manifests
@@ -102,6 +131,7 @@
 added 4 changesets with 4 changes to 1 files
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+====== Log -R full.hg in partial
 changeset:   8:836ac62537ab
 tag:         tip
 parent:      3:ac69c658229d
@@ -150,6 +180,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     0.0
 
+====== Incoming full.hg in partial
 comparing with bundle://../full.hg
 searching for changes
 changeset:   4:5f4f3ceb285e
@@ -180,6 +211,7 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     0.3m
 
+====== Outgoing -R full.hg vs partial2 in partial
 comparing with ../partial2
 searching for changes
 changeset:   4:5f4f3ceb285e
@@ -210,7 +242,9 @@
 date:        Mon Jan 12 13:46:40 1970 +0000
 summary:     0.3m
 
+====== Outgoing -R does-not-exist.hg vs partial2 in partial
 abort: No such file or directory: ../does-not-exist.hg
+====== Unbundle incremental bundles into fresh empty in one go
 adding changesets
 adding manifests
 adding file changes
@@ -220,6 +254,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+====== test for 540d1059c802
 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
 searching for changes
 comparing with ../bundle.hg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-pull-from-bundle	Wed Dec 19 19:23:18 2007 -0800
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+echo "[extensions]" >> $HGRCPATH
+echo "mq=" >> $HGRCPATH
+echo "[defaults]" >> $HGRCPATH
+echo "log = --template \"{rev}: {desc}\\n\"" >> $HGRCPATH
+echo "heads = --template \"{rev}: {desc}\\n\"" >> $HGRCPATH
+echo "incoming = --template \"{rev}: {desc}\\n\"" >> $HGRCPATH
+
+echo "====== .hgrc"
+cat $HGRCPATH
+
+echo "====== Setup main"
+hg init base
+cd base
+echo "One" > one
+hg add
+hg ci -m "main: one added."
+echo "++" >> one
+hg ci -m "main: one updated."
+
+echo "====== Bundle main"
+hg bundle --base=null ../main.hg
+cd ..
+
+echo "====== Incoming to fresh repo"
+hg init fresh
+echo ">> hg -R fresh incoming main.hg"
+hg -R fresh incoming main.hg
+echo ">> hg -R fresh incoming bundle:fresh+main.hg"
+hg -R fresh incoming bundle:fresh+main.hg
+
+
+echo "====== Setup queue"
+cd base
+hg qinit -c
+hg qnew -m "patch: two added." two.patch
+echo two > two
+hg add
+hg qrefresh
+hg qcommit -m "queue: two.patch added."
+hg qpop -a
+
+echo "====== Bundle queue"
+hg -R .hg/patches bundle --base=null ../queue.hgq
+cd ..
+
+
+echo "====== Clone base"
+hg clone base copy
+cd copy
+hg qinit -c
+
+echo "====== Incoming queue bundle"
+echo ">> hg -R .hg/patches incoming ../queue.hgq"
+hg -R .hg/patches incoming ../queue.hgq
+
+echo "====== Pull queue bundle"
+echo ">> hg -R .hg/patches pull --update ../queue.hgq"
+hg -R .hg/patches pull --update ../queue.hgq
+echo ">> hg -R .hg/patches heads"
+hg -R .hg/patches heads
+echo ">> hg -R .hg/patches log"
+hg -R .hg/patches log
+echo ">> hg qseries"
+hg qseries
+cd ..
+
+
+echo "====== Clone base again"
+hg clone base copy2
+cd copy2
+hg qinit -c
+
+echo "====== Unbundle queue bundle"
+echo ">> hg -R .hg/patches unbundle --update ../queue.hgq"
+hg -R .hg/patches unbundle --update ../queue.hgq
+echo ">> hg -R .hg/patches heads"
+hg -R .hg/patches heads
+echo ">> hg -R .hg/patches log"
+hg -R .hg/patches log
+echo ">> hg qseries"
+hg qseries
+cd ..
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-mq-pull-from-bundle.out	Wed Dec 19 19:23:18 2007 -0800
@@ -0,0 +1,68 @@
+====== .hgrc
+[ui]
+slash = True
+[defaults]
+backout = -d "0 0"
+commit = -d "0 0"
+debugrawcommit = -d "0 0"
+tag = -d "0 0"
+[extensions]
+mq=
+[defaults]
+log = --template "{rev}: {desc}\n"
+heads = --template "{rev}: {desc}\n"
+incoming = --template "{rev}: {desc}\n"
+====== Setup main
+adding one
+====== Bundle main
+====== Incoming to fresh repo
+>> hg -R fresh incoming main.hg
+comparing with main.hg
+0: main: one added.
+1: main: one updated.
+>> hg -R fresh incoming bundle:fresh+main.hg
+comparing with bundle:fresh+main.hg
+0: main: one added.
+1: main: one updated.
+====== Setup queue
+adding two
+Patch queue now empty
+====== Bundle queue
+====== Clone base
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+====== Incoming queue bundle
+>> hg -R .hg/patches incoming ../queue.hgq
+comparing with ../queue.hgq
+0: queue: two.patch added.
+====== Pull queue bundle
+>> hg -R .hg/patches pull --update ../queue.hgq
+pulling from ../queue.hgq
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 3 changes to 3 files
+merging series
+2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+>> hg -R .hg/patches heads
+0: queue: two.patch added.
+>> hg -R .hg/patches log
+0: queue: two.patch added.
+>> hg qseries
+two.patch
+====== Clone base again
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+====== Unbundle queue bundle
+>> hg -R .hg/patches unbundle --update ../queue.hgq
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 3 changes to 3 files
+merging series
+2 files updated, 1 files merged, 0 files removed, 0 files unresolved
+>> hg -R .hg/patches heads
+0: queue: two.patch added.
+>> hg -R .hg/patches log
+0: queue: two.patch added.
+>> hg qseries
+two.patch
--- a/tests/test-tags	Wed Dec 19 19:21:30 2007 -0800
+++ b/tests/test-tags	Wed Dec 19 19:23:18 2007 -0800
@@ -126,3 +126,21 @@
 hg tag -m 'retag rev 0' -fr 0 bar  # rev 4 bar -> 0, but bar stays at 2
 echo % bar should still point to rev 2
 hg tags
+
+
+# test that removing global/local tags does not get confused when trying
+# to remove a tag of type X which actually only exists as a type Y
+cd ..
+hg init t5
+cd t5
+echo foo > foo
+hg add
+hg ci -m 'add foo'                 # rev 0
+
+hg tag -r 0 -l localtag
+hg tag --remove localtag
+
+hg tag -r 0 globaltag
+hg tag --remove -l globaltag
+hg tags -v
+exit 0
--- a/tests/test-tags.out	Wed Dec 19 19:21:30 2007 -0800
+++ b/tests/test-tags.out	Wed Dec 19 19:23:18 2007 -0800
@@ -71,3 +71,9 @@
 % bar should still point to rev 2
 tip                                4:40af5d225513
 bar                                2:72b852876a42
+adding foo
+abort: localtag tag is local
+abort: globaltag tag is global
+tip                                1:a0b6fe111088
+localtag                           0:bbd179dfa0a7 local
+globaltag                          0:bbd179dfa0a7