# HG changeset patch # User Matt Mackall # Date 1364596031 25200 # Node ID 662315d6b8b8e156f0e8516ea49bc4c4c96e7ada # Parent 43dfb6fce6a76168766f3b73f4c991ab811590ec# Parent 1c8e0d6ac3b0269a409caf40a23cc83569ce9474 merge with i18n diff -r 43dfb6fce6a7 -r 662315d6b8b8 hgext/rebase.py --- a/hgext/rebase.py Fri Mar 01 11:54:36 2013 -0300 +++ b/hgext/rebase.py Fri Mar 29 15:27:11 2013 -0700 @@ -112,6 +112,7 @@ Returns 0 on success, 1 if nothing to rebase. """ originalwd = target = None + activebookmark = None external = nullrev state = {} skipped = set() @@ -159,7 +160,7 @@ ui.warn(_('tool option will be ignored\n')) (originalwd, target, state, skipped, collapsef, keepf, - keepbranchesf, external) = restorestatus(repo) + keepbranchesf, external, activebookmark) = restorestatus(repo) if abortf: return abort(repo, originalwd, target, state) else: @@ -245,7 +246,7 @@ # Keep track of the current bookmarks in order to reset them later currentbookmarks = repo._bookmarks.copy() - activebookmark = repo._bookmarkcurrent + activebookmark = activebookmark or repo._bookmarkcurrent if activebookmark: bookmarks.unsetcurrent(repo) @@ -258,7 +259,7 @@ ui.progress(_("rebasing"), pos, ("%d:%s" % (rev, repo[rev])), _('changesets'), total) storestatus(repo, originalwd, target, state, collapsef, keepf, - keepbranchesf, external) + keepbranchesf, external, activebookmark) p1, p2 = defineparents(repo, rev, target, state, targetancestors) if len(repo.parents()) == 2: @@ -516,7 +517,7 @@ marks.write() def storestatus(repo, originalwd, target, state, collapse, keep, keepbranches, - external): + external, activebookmark): 'Store the current status to allow recovery' f = repo.opener("rebasestate", "w") f.write(repo[originalwd].hex() + '\n') @@ -525,6 +526,7 @@ f.write('%d\n' % int(collapse)) f.write('%d\n' % int(keep)) f.write('%d\n' % int(keepbranches)) + f.write('%s\n' % (activebookmark or '')) for d, v in state.iteritems(): oldrev = repo[d].hex() if v > nullmerge: @@ -545,6 +547,7 @@ target = None collapse = False external = nullrev + activebookmark = None state = {} f = repo.opener("rebasestate") for i, l in enumerate(f.read().splitlines()): @@ -560,6 +563,10 @@ keep = bool(int(l)) elif i == 5: keepbranches = bool(int(l)) + elif i == 6 and not (len(l) == 81 and ':' in l): + # line 6 is a recent addition, so for backwards compatibility + # check that the line doesn't look like the oldrev:newrev lines + activebookmark = l else: oldrev, newrev = l.split(':') if newrev in (str(nullmerge), str(revignored)): @@ -577,7 +584,7 @@ repo.ui.debug('computed skipped revs: %s\n' % skipped) repo.ui.debug('rebase status resumed\n') return (originalwd, target, state, skipped, - collapse, keep, keepbranches, external) + collapse, keep, keepbranches, external, activebookmark) except IOError, err: if err.errno != errno.ENOENT: raise diff -r 43dfb6fce6a7 -r 662315d6b8b8 mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Mar 01 11:54:36 2013 -0300 +++ b/mercurial/localrepo.py Fri Mar 29 15:27:11 2013 -0700 @@ -1416,9 +1416,8 @@ # removed. We can either remove phasecache from the filecache, # causing it to reload next time it is accessed, or simply filter # the removed nodes now and write the updated cache. - if '_phasecache' in self._filecache: - self._phasecache.filterunknown(self) - self._phasecache.write() + self._phasecache.filterunknown(self) + self._phasecache.write() # update the 'served' branch cache to help read only server process # Thanks to branchcach collaboration this is done from the nearest diff -r 43dfb6fce6a7 -r 662315d6b8b8 setup.py --- a/setup.py Fri Mar 01 11:54:36 2013 -0300 +++ b/setup.py Fri Mar 29 15:27:11 2013 -0700 @@ -149,7 +149,8 @@ # a missing __init__.py in mercurial/locale, we also ignore that. err = [e for e in err.splitlines() if not e.startswith(b('Not trusting file')) \ - and not e.startswith(b('warning: Not importing'))] + and not e.startswith(b('warning: Not importing')) \ + and not e.startswith(b('obsolete feature not enabled'))] if err: print >> sys.stderr, "stderr from '%s':" % (' '.join(cmd)) print >> sys.stderr, '\n'.join([' ' + e for e in err]) @@ -519,11 +520,36 @@ setup(name='mercurial', version=setupversion, - author='Matt Mackall', - author_email='mpm@selenic.com', + author='Matt Mackall and many others', + author_email='mercurial@selenic.com', url='http://mercurial.selenic.com/', - description='Scalable distributed SCM', - license='GNU GPLv2+', + download_url='http://mercurial.selenic.com/release/', + description=('Fast scalable distributed SCM (revision control, version ' + 'control) system'), + long_description=('Mercurial is a distributed SCM tool written in Python.' + ' It is used by a number of large projects that require' + ' fast, reliable distributed revision control, such as ' + 'Mozilla.'), + license='GNU GPLv2 or any later version', + classifiers=[ + 'Development Status :: 6 - Mature', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: GNU General Public License (GPL)', + 'Natural Language :: Danish', + 'Natural Language :: English', + 'Natural Language :: German', + 'Natural Language :: Italian', + 'Natural Language :: Japanese', + 'Natural Language :: Portuguese (Brazilian)', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: OS Independent', + 'Operating System :: POSIX', + 'Programming Language :: C', + 'Programming Language :: Python', + 'Topic :: Software Development :: Version Control', + ], scripts=scripts, packages=packages, py_modules=pymodules, diff -r 43dfb6fce6a7 -r 662315d6b8b8 tests/test-commandserver.py --- a/tests/test-commandserver.py Fri Mar 01 11:54:36 2013 -0300 +++ b/tests/test-commandserver.py Fri Mar 29 15:27:11 2013 -0700 @@ -236,6 +236,27 @@ f.close() runcommand(server, ['status', '-i', '-u']) +def phasecacheafterstrip(server): + readchannel(server) + + # create new head, 5:731265503d86 + runcommand(server, ['update', '-C', '0']) + f = open('a', 'ab') + f.write('a\n') + f.close() + runcommand(server, ['commit', '-Am.', 'a']) + runcommand(server, ['log', '-Gq']) + + # make it public; draft marker moves to 4:7966c8e3734d + runcommand(server, ['phase', '-p', '.']) + runcommand(server, ['phase', '.']) # load _phasecache.phaseroots + + # strip 1::4 outside server + os.system('hg --config extensions.mq= strip 1') + + # shouldn't raise "7966c8e3734d: no node!" + runcommand(server, ['branches']) + if __name__ == '__main__': os.system('hg init') @@ -258,3 +279,4 @@ check(rollback) check(branch) check(hgignore) + check(phasecacheafterstrip) diff -r 43dfb6fce6a7 -r 662315d6b8b8 tests/test-commandserver.py.out --- a/tests/test-commandserver.py.out Fri Mar 01 11:54:36 2013 -0300 +++ b/tests/test-commandserver.py.out Fri Mar 29 15:27:11 2013 -0700 @@ -164,3 +164,29 @@ adding .hgignore runcommand status -i -u I ignored-file + +testing phasecacheafterstrip: + + runcommand update -C 0 +1 files updated, 0 files merged, 2 files removed, 0 files unresolved + runcommand commit -Am. a +created new head + runcommand log -Gq +@ 5:731265503d86 +| +| o 4:7966c8e3734d +| | +| o 3:b9b85890c400 +| | +| o 2:aef17e88f5f0 +| | +| o 1:d3a0a68be6de +|/ +o 0:eff892de26ec + + runcommand phase -p . + runcommand phase . +5: public +saved backup bundle to $TESTTMP/.hg/strip-backup/d3a0a68be6de-backup.hg + runcommand branches +default 1:731265503d86 diff -r 43dfb6fce6a7 -r 662315d6b8b8 tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t Fri Mar 01 11:54:36 2013 -0300 +++ b/tests/test-rebase-conflicts.t Fri Mar 29 15:27:11 2013 -0700 @@ -7,7 +7,7 @@ > publish=False > > [alias] - > tglog = log -G --template "{rev}:{phase} '{desc}' {branches}\n" + > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n" > EOF $ hg init a @@ -36,11 +36,12 @@ $ echo l3 >> extra2 $ hg add extra2 $ hg ci -m L3 + $ hg bookmark mybook $ hg phase --force --secret 4 $ hg tglog - @ 5:secret 'L3' + @ 5:secret 'L3' mybook | o 4:secret 'L2' | @@ -81,7 +82,7 @@ saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) $ hg tglog - @ 5:secret 'L3' + @ 5:secret 'L3' mybook | o 4:secret 'L2' | @@ -118,4 +119,8 @@ $ hg cat -r 5 common resolved merge +Bookmark stays active after --continue + $ hg bookmarks + * mybook 5:d67b21408fc0 + $ cd ..