# HG changeset patch # User Matt Mackall # Date 1237315613 18000 # Node ID 166b6b12df44819a48f094d2b1699f781dec889c # Parent 1cb6836946beaaaf18e9e1dfb043b7932ef87cfb# Parent aa1a87f7544f3d74c20be3d42b0a5cdda3ec72aa Merge with stable diff -r 1cb6836946be -r 166b6b12df44 hgext/convert/subversion.py --- a/hgext/convert/subversion.py Mon Mar 09 18:44:44 2009 +0100 +++ b/hgext/convert/subversion.py Tue Mar 17 13:46:53 2009 -0500 @@ -463,7 +463,7 @@ return int(rev.split('@')[-1]) def revsplit(self, rev): - url, revnum = rev.encode(self.encoding).split('@', 1) + url, revnum = rev.encode(self.encoding).rsplit('@', 1) revnum = int(revnum) parts = url.split('/', 1) uuid = parts.pop(0)[4:] diff -r 1cb6836946be -r 166b6b12df44 hgext/fetch.py --- a/hgext/fetch.py Mon Mar 09 18:44:44 2009 +0100 +++ b/hgext/fetch.py Tue Mar 17 13:46:53 2009 -0500 @@ -52,7 +52,9 @@ raise util.Abort(_('outstanding uncommitted changes')) if del_: raise util.Abort(_('working directory is missing some files')) - if len(repo.branchheads(branch)) > 1: + bheads = repo.branchheads(branch) + bheads = [head for head in bheads if len(repo[head].children()) == 0] + if len(bheads) > 1: raise util.Abort(_('multiple heads in this branch ' '(use "hg heads ." and "hg merge" to merge)')) @@ -76,6 +78,7 @@ # Is this a simple fast-forward along the current branch? newheads = repo.branchheads(branch) + newheads = [head for head in newheads if len(repo[head].children()) == 0] newchildren = repo.changelog.nodesbetween([parent], newheads)[2] if len(newheads) == 1: if newchildren[0] != parent: diff -r 1cb6836946be -r 166b6b12df44 hgext/keyword.py --- a/hgext/keyword.py Mon Mar 09 18:44:44 2009 +0100 +++ b/hgext/keyword.py Tue Mar 17 13:46:53 2009 -0500 @@ -425,10 +425,14 @@ keyword substitutions. Monkeypatches patch and webcommands.''' - if (not hasattr(repo, 'dirstate') or not kwtools['inc'] - or kwtools['hgcmd'] in nokwcommands.split() - or '.hg' in util.splitpath(repo.root)): - return + try: + if (not repo.local() or not kwtools['inc'] + or kwtools['hgcmd'] in nokwcommands.split() + or '.hg' in util.splitpath(repo.root) + or repo._url.startswith('bundle:')): + return + except AttributeError: + pass kwtools['templater'] = kwt = kwtemplater(ui, repo) diff -r 1cb6836946be -r 166b6b12df44 mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py Mon Mar 09 18:44:44 2009 +0100 +++ b/mercurial/bundlerepo.py Tue Mar 17 13:46:53 2009 -0500 @@ -226,7 +226,7 @@ self.manifest return self.filestart else: - raise AttributeError(name) + return localrepo.localrepository.__getattr__(self, name) def url(self): return self._url diff -r 1cb6836946be -r 166b6b12df44 mercurial/commands.py --- a/mercurial/commands.py Mon Mar 09 18:44:44 2009 +0100 +++ b/mercurial/commands.py Tue Mar 17 13:46:53 2009 -0500 @@ -331,7 +331,7 @@ try: while changesets: # update state - status = os.spawnl(os.P_WAIT, commandpath) + status = os.spawnl(os.P_WAIT, commandpath, commandpath) if status == 125: transition = "skip" elif status == 0: @@ -645,9 +645,6 @@ elif ui.verbose: ui.write(_('committed changeset %d:%s\n') % (rev,short(node))) - ms = merge_.mergestate(repo) - ms.reset(node) - def copy(ui, repo, *pats, **opts): """mark files as copied for the next commit @@ -2363,8 +2360,17 @@ else: wctx = repo[None] mctx = wctx.parents()[-1] + + # backup pre-resolve (merge uses .orig for its own purposes) + a = repo.wjoin(f) + util.copyfile(a, a + ".resolve") + + # resolve file ms.resolve(f, wctx, mctx) + # replace filemerge's .orig file with our resolve file + util.rename(a + ".resolve", a + ".orig") + def revert(ui, repo, *pats, **opts): """restore individual files or dirs to an earlier state diff -r 1cb6836946be -r 166b6b12df44 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Mar 09 18:44:44 2009 +0100 +++ b/mercurial/localrepo.py Tue Mar 17 13:46:53 2009 -0500 @@ -824,8 +824,11 @@ "(see hg resolve)")) wctx = context.workingctx(self, (p1, p2), text, user, date, extra, changes) - return self._commitctx(wctx, force, force_editor, empty_ok, - use_dirstate, update_dirstate) + r = self._commitctx(wctx, force, force_editor, empty_ok, + use_dirstate, update_dirstate) + ms.reset() + return r + finally: del lock, wlock diff -r 1cb6836946be -r 166b6b12df44 mercurial/merge.py --- a/mercurial/merge.py Mon Mar 09 18:44:44 2009 +0100 +++ b/mercurial/merge.py Tue Mar 17 13:46:53 2009 -0500 @@ -14,9 +14,10 @@ def __init__(self, repo): self._repo = repo self._read() - def reset(self, node): + def reset(self, node=None): self._state = {} - self._local = node + if node: + self._local = node shutil.rmtree(self._repo.join("merge"), True) def _read(self): self._state = {} diff -r 1cb6836946be -r 166b6b12df44 templates/atom/changelogentry.tmpl --- a/templates/atom/changelogentry.tmpl Mon Mar 09 18:44:44 2009 +0100 +++ b/templates/atom/changelogentry.tmpl Tue Mar 17 13:46:53 2009 -0500 @@ -1,6 +1,6 @@ #desc|strip|firstline|strip|escape# - http://www.selenic.com/mercurial/#changeset-{node} + {urlbase}{url}#changeset-{node} #author|person|escape# diff -r 1cb6836946be -r 166b6b12df44 templates/atom/tagentry.tmpl --- a/templates/atom/tagentry.tmpl Mon Mar 09 18:44:44 2009 +0100 +++ b/templates/atom/tagentry.tmpl Tue Mar 17 13:46:53 2009 -0500 @@ -1,7 +1,7 @@ #tag|escape# - http://www.selenic.com/mercurial/#tag-{node} + {urlbase}{url}#tag-{node} #date|rfc3339date# #date|rfc3339date# #tag|strip|escape# diff -r 1cb6836946be -r 166b6b12df44 tests/test-bundle --- a/tests/test-bundle Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-bundle Tue Mar 17 13:46:53 2009 -0500 @@ -34,6 +34,7 @@ echo "====== Bundle --all" hg -R test bundle --all all.hg + echo "====== Bundle test to full.hg" hg -R test bundle full.hg empty echo "====== Unbundle full.hg in test" @@ -139,4 +140,10 @@ # but, regular verify must continue to work hg -R orig verify +echo "====== diff against bundle" +hg init b +cd b +hg -R ../all.hg diff -r tip +cd .. + diff -r 1cb6836946be -r 166b6b12df44 tests/test-bundle.out --- a/tests/test-bundle.out Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-bundle.out Tue Mar 17 13:46:53 2009 -0500 @@ -317,3 +317,12 @@ crosschecking files in changesets and manifests checking files 2 files, 2 changesets, 2 total revisions +====== diff against bundle +diff -r 836ac62537ab anotherfile +--- a/anotherfile Mon Jan 12 13:46:40 1970 +0000 ++++ /dev/null Thu Jan 01 00:00:00 1970 +0000 +@@ -1,4 +0,0 @@ +-0 +-1 +-2 +-3 diff -r 1cb6836946be -r 166b6b12df44 tests/test-fetch --- a/tests/test-fetch Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-fetch Tue Mar 17 13:46:53 2009 -0500 @@ -170,6 +170,21 @@ hg -R n2 parents --template '{rev}\n' rm -fr n1 n2 +echo % test fetch with inactive branches +hg init ib1 +echo a > ib1/a +hg --cwd ib1 ci -Am base +hg --cwd ib1 branch second +echo b > ib1/b +hg --cwd ib1 ci -Am onsecond +hg --cwd ib1 branch -f default +echo c > ib1/c +hg --cwd ib1 ci -Am newdefault +hg clone ib1 ib2 +echo % fetch should succeed +hg --cwd ib2 fetch ../ib1 +rm -fr ib1 ib2 + "$TESTDIR/killdaemons.py" true diff -r 1cb6836946be -r 166b6b12df44 tests/test-fetch.out --- a/tests/test-fetch.out Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-fetch.out Tue Mar 17 13:46:53 2009 -0500 @@ -178,3 +178,15 @@ abort: working dir not at branch tip (use "hg update" to check out branch tip) % parent should be 0 (fetch did not update or merge anything) 0 +% test fetch with inactive branches +adding a +marked working directory as branch second +adding b +marked working directory as branch default +adding c +updating working directory +3 files updated, 0 files merged, 0 files removed, 0 files unresolved +% fetch should succeed +pulling from ../ib1 +searching for changes +no changes found diff -r 1cb6836946be -r 166b6b12df44 tests/test-hgweb-commands.out Binary file tests/test-hgweb-commands.out has changed diff -r 1cb6836946be -r 166b6b12df44 tests/test-hgweb-no-path-info.out --- a/tests/test-hgweb-no-path-info.out Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-hgweb-no-path-info.out Tue Mar 17 13:46:53 2009 -0500 @@ -19,7 +19,7 @@ test - http://www.selenic.com/mercurial/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e + http://127.0.0.1/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e Testing diff -r 1cb6836946be -r 166b6b12df44 tests/test-hgweb-no-request-uri.out --- a/tests/test-hgweb-no-request-uri.out Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-hgweb-no-request-uri.out Tue Mar 17 13:46:53 2009 -0500 @@ -19,7 +19,7 @@ test - http://www.selenic.com/mercurial/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e + http://127.0.0.1/#changeset-4cbec7e6f8c42eb52b6b52670e1f7560ae9a101e Testing diff -r 1cb6836946be -r 166b6b12df44 tests/test-hgwebdir.out --- a/tests/test-hgwebdir.out Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-hgwebdir.out Tue Mar 17 13:46:53 2009 -0500 @@ -64,7 +64,7 @@ a - http://127.0.0.1/mercurial/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab + http://127.0.0.1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab test @@ -93,7 +93,7 @@ a - http://127.0.0.1/mercurial/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab + http://127.0.0.1/t/a/#changeset-8580ff50825a50c8f716709acdf8de0deddcd6ab test diff -r 1cb6836946be -r 166b6b12df44 tests/test-merge9 --- a/tests/test-merge9 Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-merge9 Tue Mar 17 13:46:53 2009 -0500 @@ -37,6 +37,7 @@ echo % show hg resolve -l +hg st echo % re-resolve baz hg resolve baz diff -r 1cb6836946be -r 166b6b12df44 tests/test-merge9.out --- a/tests/test-merge9.out Mon Mar 09 18:44:44 2009 +0100 +++ b/tests/test-merge9.out Tue Mar 17 13:46:53 2009 -0500 @@ -23,6 +23,10 @@ % show U bar U baz +M bar +M baz +M quux2 +? bar.orig % re-resolve baz merging baz and foo to baz % after