Mercurial > hg-stable
changeset 16559:038b389d80f5 stable
merge with i18n
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 30 Apr 2012 16:06:37 -0500 |
parents | 9dba55369cd8 (diff) 6b7f8d0e2ff9 (current diff) |
children | f2a3ce017355 |
files | |
diffstat | 27 files changed, 278 insertions(+), 56 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/plan9/9diff Sun Apr 29 21:15:06 2012 +0900 +++ b/contrib/plan9/9diff Mon Apr 30 16:06:37 2012 -0500 @@ -3,13 +3,13 @@ rfork e -fn getfiles{ - cd $1 && \ +fn getfiles { + cd $1 && for(f in `{du -as | awk '{print $2}'}) test -f $f && echo `{cleanname $f} } -fn usage{ +fn usage { echo >[1=2] usage: 9diff [diff options] parent child root exit usage }
--- a/contrib/plan9/mkfile Sun Apr 29 21:15:06 2012 +0900 +++ b/contrib/plan9/mkfile Mon Apr 30 16:06:37 2012 -0500 @@ -29,9 +29,9 @@ cd $ROOT $SH -c '$PYTHON setup.py $PURE install \ --install-scripts $PYTHONBIN \ - --skip-build' \ - --force + --skip-build \ + --force' } mkdir -p /lib/mercurial/hgrc.d - dircp hgrc.d /lib/mercurial/hgrc.d - cp 9diff /rc/bin + dircp hgrc.d /lib/mercurial/hgrc.d/ + cp 9diff /rc/bin/
--- a/contrib/win32/ReadMe.html Sun Apr 29 21:15:06 2012 +0900 +++ b/contrib/win32/ReadMe.html Mon Apr 30 16:06:37 2012 -0500 @@ -140,7 +140,7 @@ </p> <p> - Mercurial is Copyright 2005-2010 Matt Mackall and others. See + Mercurial is Copyright 2005-2012 Matt Mackall and others. See the <tt>Contributors.txt</tt> file for a list of contributors. </p>
--- a/doc/hg.1.txt Sun Apr 29 21:15:06 2012 +0900 +++ b/doc/hg.1.txt Mon Apr 30 16:06:37 2012 -0500 @@ -112,7 +112,7 @@ Copying ------- -Copyright (C) 2005-2010 Matt Mackall. +Copyright (C) 2005-2012 Matt Mackall. Free use of this software is granted under the terms of the GNU General Public License version 2 or any later version.
--- a/doc/hgignore.5.txt Sun Apr 29 21:15:06 2012 +0900 +++ b/doc/hgignore.5.txt Mon Apr 30 16:06:37 2012 -0500 @@ -26,7 +26,7 @@ Copying ------- This manual page is copyright 2006 Vadim Gelfer. -Mercurial is copyright 2005-2010 Matt Mackall. +Mercurial is copyright 2005-2012 Matt Mackall. Free use of this software is granted under the terms of the GNU General Public License version 2 or any later version.
--- a/doc/hgrc.5.txt Sun Apr 29 21:15:06 2012 +0900 +++ b/doc/hgrc.5.txt Mon Apr 30 16:06:37 2012 -0500 @@ -34,7 +34,7 @@ Copying ------- This manual page is copyright 2005 Bryan O'Sullivan. -Mercurial is copyright 2005-2010 Matt Mackall. +Mercurial is copyright 2005-2012 Matt Mackall. Free use of this software is granted under the terms of the GNU General Public License version 2 or any later version.
--- a/hgext/largefiles/lfcommands.py Sun Apr 29 21:15:06 2012 +0900 +++ b/hgext/largefiles/lfcommands.py Mon Apr 30 16:06:37 2012 -0500 @@ -248,7 +248,7 @@ mctx = context.memctx(rdst, parents, ctx.description(), dstfiles, getfilectx, ctx.user(), ctx.date(), ctx.extra()) ret = rdst.commitctx(mctx) - rdst.dirstate.setparents(ret) + rdst.setparents(ret) revmap[ctx.node()] = rdst.changelog.tip() # Generate list of changed files
--- a/hgext/mq.py Sun Apr 29 21:15:06 2012 +0900 +++ b/hgext/mq.py Mon Apr 30 16:06:37 2012 -0500 @@ -749,7 +749,7 @@ for f in merged: repo.dirstate.merge(f) p1, p2 = repo.dirstate.parents() - repo.dirstate.setparents(p1, merge) + repo.setparents(p1, merge) match = scmutil.matchfiles(repo, files or []) oldtip = repo['tip'] @@ -1355,7 +1355,7 @@ fctx = ctx[f] repo.wwrite(f, fctx.data(), fctx.flags()) repo.dirstate.normal(f) - repo.dirstate.setparents(qp, nullid) + repo.setparents(qp, nullid) for patch in reversed(self.applied[start:end]): self.ui.status(_("popping %s\n") % patch.name) del self.applied[start:end] @@ -1546,7 +1546,7 @@ oldphase = repo[top].phase() # assumes strip can roll itself back if interrupted - repo.dirstate.setparents(*cparents) + repo.setparents(*cparents) self.applied.pop() self.applieddirty = True self.strip(repo, [top], update=False,
--- a/hgext/rebase.py Sun Apr 29 21:15:06 2012 +0900 +++ b/hgext/rebase.py Mon Apr 30 16:06:37 2012 -0500 @@ -277,7 +277,7 @@ editor=editor) else: # Skip commit if we are collapsing - repo.dirstate.setparents(repo[p1].node()) + repo.setparents(repo[p1].node()) newrev = None # Update the state if newrev is not None: @@ -361,7 +361,7 @@ def concludenode(repo, rev, p1, p2, commitmsg=None, editor=None, extrafn=None): 'Commit the changes and store useful information in extra' try: - repo.dirstate.setparents(repo[p1].node(), repo[p2].node()) + repo.setparents(repo[p1].node(), repo[p2].node()) ctx = repo[rev] if commitmsg is None: commitmsg = ctx.description()
--- a/hgext/transplant.py Sun Apr 29 21:15:06 2012 +0900 +++ b/hgext/transplant.py Mon Apr 30 16:06:37 2012 -0500 @@ -274,7 +274,7 @@ files = None if merge: p1, p2 = repo.dirstate.parents() - repo.dirstate.setparents(p1, node) + repo.setparents(p1, node) m = match.always(repo.root, '') else: m = match.exact(repo.root, '', files) @@ -340,7 +340,7 @@ _('working dir not at transplant parent %s') % revlog.hex(parent)) if merge: - repo.dirstate.setparents(p1, parents[1]) + repo.setparents(p1, parents[1]) n = repo.commit(message, user, date, extra=extra, editor=self.editor) if not n:
--- a/mercurial/changegroup.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/changegroup.py Mon Apr 30 16:06:37 2012 -0500 @@ -118,7 +118,7 @@ elif alg == 'GZ': def generator(f): zd = zlib.decompressobj() - for chunk in f: + for chunk in util.filechunkiter(f): yield zd.decompress(chunk) elif alg == 'BZ': def generator(f):
--- a/mercurial/cmdutil.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/cmdutil.py Mon Apr 30 16:06:37 2012 -0500 @@ -1296,9 +1296,6 @@ wlock = repo.wlock() try: - # Fix up dirstate for copies and renames - duplicatecopies(repo, None, base.node()) - # First, do a regular commit to record all changes in the working # directory (if there are any) node = commit(ui, repo, commitfunc, pats, opts) @@ -1326,6 +1323,8 @@ date = ctx.date() message = ctx.description() extra = ctx.extra() + # Recompute copies (avoid recording a -> b -> a) + copied = copies.pathcopies(base, ctx) # Prune files which were reverted by the updates: if old introduced # file X and our intermediate commit, node, renamed that file, then @@ -1339,8 +1338,7 @@ if f in base.manifest(): b = base.filectx(f) return (a.data() == b.data() - and a.flags() == b.flags() - and a.renamed() == b.renamed()) + and a.flags() == b.flags()) else: return False else: @@ -1349,7 +1347,13 @@ def filectxfn(repo, ctx_, path): try: - return ctx.filectx(path) + fctx = ctx[path] + flags = fctx.flags() + mctx = context.memfilectx(fctx.path(), fctx.data(), + islink='l' in flags, + isexec='x' in flags, + copied=copied.get(path)) + return mctx except KeyError: raise IOError() else: @@ -1384,7 +1388,7 @@ newid = repo.commitctx(new) if newid != old.node(): # Reroute the working copy parent to the new changeset - repo.dirstate.setparents(newid, nullid) + repo.setparents(newid, nullid) # Move bookmarks from old parent to amend commit bms = repo.nodebookmarks(old.node())
--- a/mercurial/commands.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/commands.py Mon Apr 30 16:06:37 2012 -0500 @@ -2270,7 +2270,7 @@ wlock = repo.wlock() try: - repo.dirstate.setparents(r1, r2) + repo.setparents(r1, r2) finally: wlock.release() @@ -2693,7 +2693,7 @@ finally: ui.setconfig('ui', 'forcemerge', '') # drop the second merge parent - repo.dirstate.setparents(current.node(), nullid) + repo.setparents(current.node(), nullid) repo.dirstate.write() # fix up dirstate for copies and renames cmdutil.duplicatecopies(repo, ctx.rev(), ctx.p1().rev()) @@ -3635,7 +3635,7 @@ if p1 != parents[0]: hg.clean(repo, p1.node()) if p2 != parents[1]: - repo.dirstate.setparents(p1.node(), p2.node()) + repo.setparents(p1.node(), p2.node()) if opts.get('exact') or opts.get('import_branch'): repo.dirstate.setbranch(branch or 'default')
--- a/mercurial/dirstate.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/dirstate.py Mon Apr 30 16:06:37 2012 -0500 @@ -237,14 +237,26 @@ return encoding.tolocal(self._branch) def setparents(self, p1, p2=nullid): + """Set dirstate parents to p1 and p2. + + When moving from two parents to one, 'm' merged entries a + adjusted to normal and previous copy records discarded and + returned by the call. + + See localrepo.setparents() + """ self._dirty = self._dirtypl = True oldp2 = self._pl[1] self._pl = p1, p2 + copies = {} if oldp2 != nullid and p2 == nullid: # Discard 'm' markers when moving away from a merge state for f, s in self._map.iteritems(): if s[0] == 'm': + if f in self._copymap: + copies[f] = self._copymap[f] self.normallookup(f) + return copies def setbranch(self, branch): if branch in ['tip', '.', 'null']:
--- a/mercurial/help.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/help.py Mon Apr 30 16:06:37 2012 -0500 @@ -67,11 +67,11 @@ (['templating', 'templates'], _('Template Usage'), loaddoc('templates')), (['urls'], _('URL Paths'), loaddoc('urls')), - (["extensions"], _("Using additional features"), extshelp), + (["extensions"], _("Using Additional Features"), extshelp), (["subrepo", "subrepos"], _("Subrepositories"), loaddoc('subrepos')), (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')), (["glossary"], _("Glossary"), loaddoc('glossary')), - (["hgignore", "ignore"], _("syntax for Mercurial ignore files"), + (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"), loaddoc('hgignore')), (["phases"], _("Working with Phases"), loaddoc('phases')), ])
--- a/mercurial/help/config.txt Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/help/config.txt Mon Apr 30 16:06:37 2012 -0500 @@ -1052,20 +1052,24 @@ ``subpaths`` """""""""""" -Defines subrepositories source locations rewriting rules of the form:: +Subrepository source URLs can go stale if a remote server changes name +or becomes temporarily unavailable. This section lets you define +rewrite rules of the form:: <pattern> = <replacement> -Where ``pattern`` is a regular expression matching the source and -``replacement`` is the replacement string used to rewrite it. Groups -can be matched in ``pattern`` and referenced in ``replacements``. For -instance:: +where ``pattern`` is a regular expression matching a subrepository +source URL and ``replacement`` is the replacement string used to +rewrite it. Groups can be matched in ``pattern`` and referenced in +``replacements``. For instance:: http://server/(.*)-hg/ = http://hg.server/\1/ rewrites ``http://server/foo-hg/`` into ``http://hg.server/foo/``. -All patterns are applied in definition order. +Relative subrepository paths are first made absolute, and the the +rewrite rules are then applied on the full (absolute) path. The rules +are applied in definition order. ``trusted`` """""""""""
--- a/mercurial/localrepo.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/localrepo.py Mon Apr 30 16:06:37 2012 -0500 @@ -633,6 +633,17 @@ '''get list of changectxs for parents of changeid''' return self[changeid].parents() + def setparents(self, p1, p2=nullid): + copies = self.dirstate.setparents(p1, p2) + if copies: + # Adjust copy records, the dirstate cannot do it, it + # requires access to parents manifests. Preserve them + # only for entries added to first parent. + pctx = self[p1] + for f in copies: + if f not in pctx and copies[f] in pctx: + self.dirstate.copy(copies[f], f) + def filectx(self, path, changeid=None, fileid=None): """changeid can be a changeset revision, node, or tag. fileid can be a file revision or node."""
--- a/mercurial/merge.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/merge.py Mon Apr 30 16:06:37 2012 -0500 @@ -596,7 +596,7 @@ stats = applyupdates(repo, action, wc, p2, pa, overwrite) if not partial: - repo.dirstate.setparents(fp1, fp2) + repo.setparents(fp1, fp2) recordupdates(repo, action, branchmerge) if not branchmerge: repo.dirstate.setbranch(p2.branch())
--- a/mercurial/subrepo.py Sun Apr 29 21:15:06 2012 +0900 +++ b/mercurial/subrepo.py Mon Apr 30 16:06:37 2012 -0500 @@ -715,13 +715,24 @@ return True def basestate(self): - return self._wcrev() + lastrev, rev = self._wcrevs() + if lastrev != rev: + # Last committed rev is not the same than rev. We would + # like to take lastrev but we do not know if the subrepo + # URL exists at lastrev. Test it and fallback to rev it + # is not there. + try: + self._svncommand(['info', '%s@%s' % (self._state[0], lastrev)]) + return lastrev + except error.Abort: + pass + return rev def commit(self, text, user, date): # user and date are out of our hands since svn is centralized changed, extchanged, missing = self._wcchanged() if not changed: - return self._wcrev() + return self.basestate() if extchanged: # Do not try to commit externals raise util.Abort(_('cannot commit svn externals')) @@ -791,9 +802,10 @@ def merge(self, state): old = self._state[1] new = state[1] - if new != self._wcrev(): - dirty = old == self._wcrev() or self._wcchanged()[0] - if _updateprompt(self._ui, self, dirty, self._wcrev(), new): + wcrev = self._wcrev() + if new != wcrev: + dirty = old == wcrev or self._wcchanged()[0] + if _updateprompt(self._ui, self, dirty, wcrev, new): self.get(state, False) def push(self, opts):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/bundles/rename.sh Mon Apr 30 16:06:37 2012 -0500 @@ -0,0 +1,30 @@ +#!/bin/sh + +# @ 3: 'move2' +# | +# o 2: 'move1' +# | +# | o 1: 'change' +# |/ +# o 0: 'add' + +hg init copies +cd copies +echo a > a +echo b > b +echo c > c +hg ci -Am add +echo a >> a +echo b >> b +echo c >> c +hg ci -m change +hg up -qC 0 +hg cp a d +hg mv b e +hg mv c f +hg ci -m move1 +hg mv e g +hg mv f c +hg ci -m move2 +hg bundle -a ../renames.hg +cd ..
--- a/tests/test-commit-amend.t Sun Apr 29 21:15:06 2012 +0900 +++ b/tests/test-commit-amend.t Mon Apr 30 16:06:37 2012 -0500 @@ -287,6 +287,30 @@ A f d + $ mv f f.orig + $ hg rm -A f + $ hg ci -m removef + $ hg cp a f + $ mv f.orig f + $ hg ci --amend -m replacef + saved backup bundle to $TESTTMP/.hg/strip-backup/20a7413547f9-amend-backup.hg + $ hg st --change . --copies + $ hg log -r . --template "{file_copies}\n" + + +Move added file (issue3410): + + $ echo g >> g + $ hg ci -Am g + adding g + $ hg mv g h + $ hg ci --amend + saved backup bundle to $TESTTMP/.hg/strip-backup/5daa77a5d616-amend-backup.hg + $ hg st --change . --copies h + A h + $ hg log -r . --template "{file_copies}\n" + + Can't rollback an amend: $ hg rollback
--- a/tests/test-globalopts.t Sun Apr 29 21:15:06 2012 +0900 +++ b/tests/test-globalopts.t Mon Apr 30 16:06:37 2012 -0500 @@ -339,10 +339,10 @@ dates Date Formats diffs Diff Formats environment Environment Variables - extensions Using additional features + extensions Using Additional Features filesets Specifying File Sets glossary Glossary - hgignore syntax for Mercurial ignore files + hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb merge-tools Merge Tools multirevs Specifying Multiple Revisions @@ -423,10 +423,10 @@ dates Date Formats diffs Diff Formats environment Environment Variables - extensions Using additional features + extensions Using Additional Features filesets Specifying File Sets glossary Glossary - hgignore syntax for Mercurial ignore files + hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb merge-tools Merge Tools multirevs Specifying Multiple Revisions
--- a/tests/test-help.t Sun Apr 29 21:15:06 2012 +0900 +++ b/tests/test-help.t Mon Apr 30 16:06:37 2012 -0500 @@ -111,10 +111,10 @@ dates Date Formats diffs Diff Formats environment Environment Variables - extensions Using additional features + extensions Using Additional Features filesets Specifying File Sets glossary Glossary - hgignore syntax for Mercurial ignore files + hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb merge-tools Merge Tools multirevs Specifying Multiple Revisions @@ -189,10 +189,10 @@ dates Date Formats diffs Diff Formats environment Environment Variables - extensions Using additional features + extensions Using Additional Features filesets Specifying File Sets glossary Glossary - hgignore syntax for Mercurial ignore files + hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb merge-tools Merge Tools multirevs Specifying Multiple Revisions @@ -685,10 +685,10 @@ dates Date Formats diffs Diff Formats environment Environment Variables - extensions Using additional features + extensions Using Additional Features filesets Specifying File Sets glossary Glossary - hgignore syntax for Mercurial ignore files + hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb merge-tools Merge Tools multirevs Specifying Multiple Revisions
--- a/tests/test-rebase-collapse.t Sun Apr 29 21:15:06 2012 +0900 +++ b/tests/test-rebase-collapse.t Mon Apr 30 16:06:37 2012 -0500 @@ -541,3 +541,52 @@ @@ -0,0 +1,2 @@ +d +blah + + $ cd .. + +Rebase, collapse and copies + + $ hg init copies + $ cd copies + $ hg unbundle "$TESTDIR/bundles/renames.hg" + adding changesets + adding manifests + adding file changes + added 4 changesets with 11 changes to 7 files (+1 heads) + (run 'hg heads' to see heads, 'hg merge' to merge) + $ hg up -q tip + $ hg tglog + @ 3: 'move2' + | + o 2: 'move1' + | + | o 1: 'change' + |/ + o 0: 'add' + + $ hg rebase --collapse -d 1 + merging a and d to d + merging b and e to e + merging c and f to f + merging e and g to g + merging f and c to c + saved backup bundle to $TESTTMP/copies/.hg/strip-backup/*-backup.hg (glob) + $ hg st + $ hg st --copies --change . + A d + a + A g + b + R b + $ cat c + c + c + $ cat d + a + a + $ cat g + b + b + $ hg log -r . --template "{file_copies}\n" + d (a)g (b) + $ cd ..
--- a/tests/test-rebase-parameters.t Sun Apr 29 21:15:06 2012 +0900 +++ b/tests/test-rebase-parameters.t Mon Apr 30 16:06:37 2012 -0500 @@ -73,6 +73,13 @@ abort: cannot specify both a source and a base [255] + $ hg rebase --rev 5 --source 4 + abort: cannot specify both a revision and a source + [255] + $ hg rebase --base 5 --rev 4 + abort: cannot specify both a revision and a base + [255] + $ hg rebase nothing to rebase [1] @@ -186,7 +193,7 @@ $ hg clone -q -u . a a4 $ cd a4 - $ hg rebase --source 2 + $ hg rebase --source 'desc("C")' saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob) $ hg tglog @@ -246,7 +253,7 @@ $ hg clone -q -u . a a6 $ cd a6 - $ hg rebase --base 3 + $ hg rebase --base 'desc("D")' saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob) $ hg tglog @@ -330,6 +337,36 @@ $ cd .. + +Specify only revs (from 2 onto 8) + + $ hg clone -q -u . a a9 + $ cd a9 + + $ hg rebase --rev 'desc("C")::' + saved backup bundle to $TESTTMP/a9/.hg/strip-backup/*-backup.hg (glob) + + $ hg tglog + @ 8: 'D' + | + o 7: 'C' + |\ + | o 6: 'I' + | | + | o 5: 'H' + | | + | | o 4: 'G' + | |/| + | o | 3: 'F' + | | | + | | o 2: 'E' + | |/ + o | 1: 'B' + |/ + o 0: 'A' + + $ cd .. + Test --tool parameter: $ hg init b
--- a/tests/test-subrepo-svn.t Sun Apr 29 21:15:06 2012 +0900 +++ b/tests/test-subrepo-svn.t Mon Apr 30 16:06:37 2012 -0500 @@ -564,3 +564,42 @@ $ hg forget 'notafile*' notafile*: No such file or directory [1] + +Test a subrepo referencing a just moved svn path. Last commit rev will +be different from the revision, and the path will be different as +well. + + $ cd $WCROOT + $ svn up > /dev/null + $ mkdir trunk/subdir branches + $ echo a > trunk/subdir/a + $ svn add trunk/subdir branches + A trunk/subdir + A trunk/subdir/a + A branches + $ svn ci -m addsubdir + Adding branches + Adding trunk/subdir + Adding trunk/subdir/a + Transmitting file data . + Committed revision 14. + $ svn cp -m branchtrunk $SVNREPO/trunk $SVNREPO/branches/somebranch + + Committed revision 15. + $ cd .. + + $ hg init repo2 + $ cd repo2 + $ svn co $SVNREPO/branches/somebranch/subdir + A subdir/a + Checked out revision 15. + $ echo "subdir = [svn] $SVNREPO/branches/somebranch/subdir" > .hgsub + $ hg add .hgsub + $ hg ci -m addsub + $ hg up null + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ hg up + A *subdir/a (glob) + Checked out revision 15. + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd ..