~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Vincent Ladeuil
  • Date: 2016-01-21 11:42:23 UTC
  • mto: This revision was merged to the branch mainline in revision 6610.
  • Revision ID: v.ladeuil+lp@free.fr-20160121114223-ngcvndi02ydiqs5z
Allow hyphens in option names to unbreak compatibility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
# Author: Martin Pool <mbp@canonical.com>
18
18
 
19
 
 
20
19
"""Weave - storage of related text file versions"""
21
20
 
 
21
from __future__ import absolute_import
22
22
 
23
23
# XXX: If we do weaves this way, will a merge still behave the same
24
24
# way if it's done in a different order?  That's a pretty desirable
69
69
from copy import copy
70
70
from cStringIO import StringIO
71
71
import os
72
 
import time
73
 
import warnings
74
72
 
75
73
from bzrlib.lazy_import import lazy_import
76
74
lazy_import(globals(), """
79
77
from bzrlib import (
80
78
    errors,
81
79
    osutils,
82
 
    progress,
83
80
    )
84
81
from bzrlib.errors import (WeaveError, WeaveFormatError, WeaveParentMismatch,
85
82
        RevisionAlreadyPresent,
86
83
        RevisionNotPresent,
87
84
        UnavailableRepresentation,
88
 
        WeaveRevisionAlreadyPresent,
89
 
        WeaveRevisionNotPresent,
90
85
        )
91
86
from bzrlib.osutils import dirname, sha, sha_strings, split_lines
92
87
import bzrlib.patiencediff
925
920
        self._transport = transport
926
921
        self._filemode = filemode
927
922
        try:
928
 
            _read_weave_v5(self._transport.get(name + WeaveFile.WEAVE_SUFFIX), self)
 
923
            f = self._transport.get(name + WeaveFile.WEAVE_SUFFIX)
 
924
            _read_weave_v5(StringIO(f.read()), self)
929
925
        except errors.NoSuchFile:
930
926
            if not create:
931
927
                raise