~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/cache_utf8.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
# TODO: Some kind of command-line display of revision properties: 
 
17
# TODO: Some kind of command-line display of revision properties:
18
18
# perhaps show them in log -v and allow them as options to the commit command.
19
19
 
20
20
"""Some functions to enable caching the conversion between unicode to utf8"""
49
49
    """Take this unicode revision id, and get a unicode version"""
50
50
    # If the key is in the cache try/KeyError is 50% faster than
51
51
    # val = dict.get(key), if val is None:
52
 
    # On jam's machine the difference is 
53
 
    # try/KeyError:  900ms 
54
 
    #      if None: 1250ms 
 
52
    # On jam's machine the difference is
 
53
    # try/KeyError:  900ms
 
54
    #      if None: 1250ms
55
55
    # Since these are primarily used when iterating over a knit entry
56
56
    # *most* of the time the key will already be in the cache, so use the
57
57
    # fast path