Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 3773:b1eeaeb936ae
Handle transcoding of branch names
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 03 Dec 2006 16:16:33 -0600 |
parents | 73860ffbe798 |
children | f183c18568df |
comparison
equal
deleted
inserted
replaced
3772:73860ffbe798 | 3773:b1eeaeb936ae |
---|---|
320 tiprev = self.changelog.count() - 1 | 320 tiprev = self.changelog.count() - 1 |
321 if lrev != tiprev: | 321 if lrev != tiprev: |
322 self._updatebranchcache(partial, lrev+1, tiprev+1) | 322 self._updatebranchcache(partial, lrev+1, tiprev+1) |
323 self._writebranchcache(partial, self.changelog.tip(), tiprev) | 323 self._writebranchcache(partial, self.changelog.tip(), tiprev) |
324 | 324 |
325 self.branchcache = partial | 325 # the branch cache is stored on disk as UTF-8, but in the local |
326 # charset internally | |
327 for k, v in partial.items(): | |
328 self.branchcache[util.tolocal(k)] = v | |
326 return self.branchcache | 329 return self.branchcache |
327 | 330 |
328 def _readbranchcache(self): | 331 def _readbranchcache(self): |
329 partial = {} | 332 partial = {} |
330 try: | 333 try: |
631 c2 = self.changelog.read(p2) | 634 c2 = self.changelog.read(p2) |
632 m1 = self.manifest.read(c1[0]).copy() | 635 m1 = self.manifest.read(c1[0]).copy() |
633 m2 = self.manifest.read(c2[0]) | 636 m2 = self.manifest.read(c2[0]) |
634 | 637 |
635 if use_dirstate: | 638 if use_dirstate: |
636 branchname = self.workingctx().branch() | 639 branchname = util.fromlocal(self.workingctx().branch()) |
637 else: | 640 else: |
638 branchname = "" | 641 branchname = "" |
639 | 642 |
640 if use_dirstate: | 643 if use_dirstate: |
641 oldname = c1[5].get("branch", "") | 644 oldname = c1[5].get("branch", "") # stored in UTF-8 |
642 if not commit and not remove and not force and p2 == nullid and \ | 645 if not commit and not remove and not force and p2 == nullid and \ |
643 branchname == oldname: | 646 branchname == oldname: |
644 self.ui.status(_("nothing changed\n")) | 647 self.ui.status(_("nothing changed\n")) |
645 return None | 648 return None |
646 | 649 |