# HG changeset patch # User Matt Mackall # Date 1330719066 21600 # Node ID 8412d5a02e6e2fd9c95b63a441dd9e4e9605ac79 # Parent a0ab72ac86f9a06be45d9260c330957843011f6e# Parent 5536770b3c88f3e358c637ce547e32c484dcfb03 merge with i18n diff -r a0ab72ac86f9 -r 8412d5a02e6e .hgsigs --- a/.hgsigs Wed Feb 29 13:17:41 2012 -0300 +++ b/.hgsigs Fri Mar 02 14:11:06 2012 -0600 @@ -49,3 +49,4 @@ 6344043924497cd06d781d9014c66802285072e4 0 iD8DBQBPALgmywK+sNU5EO8RAlfhAJ9nYOdWnhfVDHYtDTJAyJtXBAQS9wCgnefoSQt7QABkbGxM+Q85UYEBuD0= db33555eafeaf9df1e18950e29439eaa706d399b 0 iD8DBQBPGdzxywK+sNU5EO8RAppkAJ9jOXhUVE/97CPgiMA0pMGiIYnesQCfengAszcBiSiKGugiI8Okc9ghU+Y= 2aa5b51f310fb3befd26bed99c02267f5c12c734 0 iD8DBQBPKZ9bywK+sNU5EO8RAt1TAJ45r1eJ0YqSkInzrrayg4TVCh0SnQCgm0GA/Ua74jnnDwVQ60lAwROuz1Q= +53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 0 iD8DBQBPT/fvywK+sNU5EO8RAnfYAKCn7d0vwqIb100YfWm1F7nFD5B+FACeM02YHpQLSNsztrBCObtqcnfod7Q= diff -r a0ab72ac86f9 -r 8412d5a02e6e .hgtags --- a/.hgtags Wed Feb 29 13:17:41 2012 -0300 +++ b/.hgtags Fri Mar 02 14:11:06 2012 -0600 @@ -61,3 +61,4 @@ 6344043924497cd06d781d9014c66802285072e4 2.0.2 db33555eafeaf9df1e18950e29439eaa706d399b 2.1-rc 2aa5b51f310fb3befd26bed99c02267f5c12c734 2.1 +53e2cd303ecf8ca7c7eeebd785c34e5ed6b0f4a4 2.1.1 diff -r a0ab72ac86f9 -r 8412d5a02e6e hgext/bugzilla.py --- a/hgext/bugzilla.py Wed Feb 29 13:17:41 2012 -0300 +++ b/hgext/bugzilla.py Fri Mar 02 14:11:06 2012 -0600 @@ -497,6 +497,7 @@ def request(self, host, handler, request_body, verbose=0): self.verbose = verbose + self.accept_gzip_encoding = False # issue XML-RPC request h = self.make_connection(host) diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/bookmarks.py --- a/mercurial/bookmarks.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/bookmarks.py Fri Mar 02 14:11:06 2012 -0600 @@ -129,11 +129,12 @@ def unsetcurrent(repo): wlock = repo.wlock() try: - util.unlink(repo.join('bookmarks.current')) - repo._bookmarkcurrent = None - except OSError, inst: - if inst.errno != errno.ENOENT: - raise + try: + util.unlink(repo.join('bookmarks.current')) + repo._bookmarkcurrent = None + except OSError, inst: + if inst.errno != errno.ENOENT: + raise finally: wlock.release() diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/bundlerepo.py Fri Mar 02 14:11:06 2012 -0600 @@ -168,6 +168,7 @@ self._tempparent = tempfile.mkdtemp() localrepo.instance(ui, self._tempparent, 1) localrepo.localrepository.__init__(self, ui, self._tempparent) + self.ui.setconfig('phases', 'publish', False) if path: self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/dirstate.py --- a/mercurial/dirstate.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/dirstate.py Fri Mar 02 14:11:06 2012 -0600 @@ -14,6 +14,17 @@ _format = ">cllll" propertycache = util.propertycache +filecache = scmutil.filecache + +class repocache(filecache): + """filecache for files in .hg/""" + def join(self, obj, fname): + return obj._opener.join(fname) + +class rootcache(filecache): + """filecache for files in the repository root""" + def join(self, obj, fname): + return obj._join(fname) def _finddirs(path): pos = path.rfind('/') @@ -52,6 +63,7 @@ self._dirtypl = False self._lastnormaltime = 0 self._ui = ui + self._filecache = {} @propertycache def _map(self): @@ -77,7 +89,7 @@ f['.'] = '.' # prevents useless util.fspath() invocation return f - @propertycache + @repocache('branch') def _branch(self): try: return self._opener.read("branch").strip() or "default" @@ -113,7 +125,7 @@ def dirs(self): return self._dirs - @propertycache + @rootcache('.hgignore') def _ignore(self): files = [self._join('.hgignore')] for name, path in self._ui.configitems("ui"): diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/filemerge.py --- a/mercurial/filemerge.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/filemerge.py Fri Mar 02 14:11:06 2012 -0600 @@ -220,6 +220,8 @@ util.copyfile(a, a + ".local") repo.wwrite(fd + ".other", fco.data(), fco.flags()) repo.wwrite(fd + ".base", fca.data(), fca.flags()) + os.unlink(b) + os.unlink(c) return 1 # unresolved else: args = _toolstr(ui, tool, "args", '$local $base $other') diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/localrepo.py Fri Mar 02 14:11:06 2012 -0600 @@ -19,6 +19,11 @@ propertycache = util.propertycache filecache = scmutil.filecache +class storecache(filecache): + """filecache for files in the store""" + def join(self, obj, fname): + return obj.sjoin(fname) + class localrepository(repo.repository): capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey', 'known', 'getbundle')) @@ -176,7 +181,7 @@ def _writebookmarks(self, marks): bookmarks.write(self) - @filecache('phaseroots', True) + @storecache('phaseroots') def _phaseroots(self): self._dirtyphases = False phaseroots = phases.readroots(self) @@ -195,7 +200,7 @@ cache[rev] = phase return cache - @filecache('00changelog.i', True) + @storecache('00changelog.i') def changelog(self): c = changelog.changelog(self.sopener) if 'HG_PENDING' in os.environ: @@ -204,7 +209,7 @@ c.readpending('00changelog.i.a') return c - @filecache('00manifest.i', True) + @storecache('00manifest.i') def manifest(self): return manifest.manifest(self.sopener) @@ -896,10 +901,13 @@ rereads the dirstate. Use dirstate.invalidate() if you want to explicitly read the dirstate again (i.e. restoring it to a previous known good state).''' - try: + if 'dirstate' in self.__dict__: + for k in self.dirstate._filecache: + try: + delattr(self.dirstate, k) + except AttributeError: + pass delattr(self, 'dirstate') - except AttributeError: - pass def invalidate(self): for k in self._filecache: diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/scmutil.py --- a/mercurial/scmutil.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/scmutil.py Fri Mar 02 14:11:06 2012 -0600 @@ -211,7 +211,7 @@ if r: raise util.Abort("%s: %r" % (r, path)) self.auditor(path) - f = os.path.join(self.base, path) + f = self.join(path) if not text and "b" not in mode: mode += "b" # for that other OS @@ -255,7 +255,7 @@ def symlink(self, src, dst): self.auditor(dst) - linkname = os.path.join(self.base, dst) + linkname = self.join(dst) try: os.unlink(linkname) except OSError: @@ -280,6 +280,9 @@ def audit(self, path): self.auditor(path) + def join(self, path): + return os.path.join(self.base, path) + class filteropener(abstractopener): '''Wrapper opener for filtering filenames with a function.''' @@ -793,9 +796,17 @@ to tell us if a file has been replaced. If it can't, we fallback to recreating the object on every call (essentially the same behaviour as propertycache).''' - def __init__(self, path, instore=False): + def __init__(self, path): self.path = path - self.instore = instore + + def join(self, obj, fname): + """Used to compute the runtime path of the cached file. + + Users should subclass filecache and provide their own version of this + function to call the appropriate join function on 'obj' (an instance + of the class that its member function was decorated). + """ + return obj.join(fname) def __call__(self, func): self.func = func @@ -813,7 +824,7 @@ if entry.changed(): entry.obj = self.func(obj) else: - path = self.instore and obj.sjoin(self.path) or obj.join(self.path) + path = self.join(obj, self.path) # We stat -before- creating the object so our cache doesn't lie if # a writer modified between the time we read and stat diff -r a0ab72ac86f9 -r 8412d5a02e6e mercurial/subrepo.py --- a/mercurial/subrepo.py Wed Feb 29 13:17:41 2012 -0300 +++ b/mercurial/subrepo.py Fri Mar 02 14:11:06 2012 -0600 @@ -500,7 +500,7 @@ anc = dst.ancestor(cur) def mergefunc(): - if anc == cur: + if anc == cur and dst.branch() == cur.branch(): self._repo.ui.debug("updating subrepo %s\n" % subrelpath(self)) hg.update(self._repo, state[1]) elif anc == dst: diff -r a0ab72ac86f9 -r 8412d5a02e6e setup.py --- a/setup.py Wed Feb 29 13:17:41 2012 -0300 +++ b/setup.py Fri Mar 02 14:11:06 2012 -0600 @@ -454,7 +454,7 @@ # distutils.sysconfig version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[0].splitlines() if version: - version = version.splitlines()[0] + version = version[0] xcode4 = (version.startswith('Xcode') and StrictVersion(version.split()[1]) >= StrictVersion('4.0')) else: diff -r a0ab72ac86f9 -r 8412d5a02e6e tests/test-commandserver.py --- a/tests/test-commandserver.py Wed Feb 29 13:17:41 2012 -0300 +++ b/tests/test-commandserver.py Fri Mar 02 14:11:06 2012 -0600 @@ -212,6 +212,27 @@ runcommand(server, ['rollback']) runcommand(server, ['phase', '-r', '.']) +def branch(server): + readchannel(server) + runcommand(server, ['branch']) + os.system('hg branch foo') + runcommand(server, ['branch']) + os.system('hg branch default') + +def hgignore(server): + readchannel(server) + f = open('.hgignore', 'ab') + f.write('') + f.close() + runcommand(server, ['commit', '-Am.']) + f = open('ignored-file', 'ab') + f.write('') + f.close() + f = open('.hgignore', 'ab') + f.write('ignored-file') + f.close() + runcommand(server, ['status', '-i', '-u']) + if __name__ == '__main__': os.system('hg init') @@ -232,3 +253,5 @@ check(tagscache) check(setphase) check(rollback) + check(branch) + check(hgignore) diff -r a0ab72ac86f9 -r 8412d5a02e6e tests/test-commandserver.py.out --- a/tests/test-commandserver.py.out Wed Feb 29 13:17:41 2012 -0300 +++ b/tests/test-commandserver.py.out Fri Mar 02 14:11:06 2012 -0600 @@ -145,3 +145,21 @@ working directory now based on revision 3 runcommand phase -r . 3: public + +testing branch: + + runcommand branch +default +marked working directory as branch foo +(branches are permanent and global, did you want a bookmark?) + runcommand branch +foo +marked working directory as branch default +(branches are permanent and global, did you want a bookmark?) + +testing hgignore: + + runcommand commit -Am. +adding .hgignore + runcommand status -i -u +I ignored-file diff -r a0ab72ac86f9 -r 8412d5a02e6e tests/test-phases-exchange.t --- a/tests/test-phases-exchange.t Wed Feb 29 13:17:41 2012 -0300 +++ b/tests/test-phases-exchange.t Fri Mar 02 14:11:06 2012 -0600 @@ -465,6 +465,38 @@ o 0 public a-A - 054250a37db4 +Pulling from bundle does not alter phases of changeset not present in the bundle + + $ hg bundle --base 1 -r 6 -r 3 ../partial-bundle.hg + 5 changesets found + $ hg pull ../partial-bundle.hg + pulling from ../partial-bundle.hg + searching for changes + no changes found + $ hgph + @ 10 draft a-H - 967b449fbc94 + | + | o 9 draft a-G - 3e27b6f1eee1 + | | + | o 8 draft a-F - b740e3e5c05d + | | + | o 7 draft a-E - e9f537e46dea + | | + +---o 6 public n-B - 145e75495359 + | | + o | 5 public n-A - d6bcb4f74035 + | | + o | 4 public b-A - f54f1bb90ff3 + | | + | o 3 public a-D - b555f63b6063 + | | + | o 2 public a-C - 54acac6f23ab + |/ + o 1 public a-B - 548a3d25dbf0 + | + o 0 public a-A - 054250a37db4 + + Pushing to Publish=False (unknown changeset) $ hg push ../mu -r b740e3e5c05d # a-F