3
3
# Copyright (C) 2005 Canonical Ltd
5
5
# This program is free software; you can redistribute it and/or modify
6
6
# it under the terms of the GNU General Public License as published by
7
7
# the Free Software Foundation; either version 2 of the License, or
8
8
# (at your option) any later version.
10
10
# This program is distributed in the hope that it will be useful,
11
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
13
# GNU General Public License for more details.
15
15
# You should have received a copy of the GNU General Public License
16
16
# along with this program; if not, write to the Free Software
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
19
"""Experiment in converting existing bzr branches to weaves."""
21
# To make this properly useful
23
# 1. assign text version ids, and put those text versions into
24
# the inventory as they're converted.
26
# 2. keep track of the previous version of each file, rather than
27
# just using the last one imported
29
# 3. assign entry versions when files are added, renamed or moved.
31
# 4. when merged-in versions are observed, walk down through them
32
# to discover everything, then commit bottom-up
34
# 5. track ancestry as things are merged in, and commit that in each
37
# Perhaps it's best to first walk the whole graph and make a plan for
38
# what should be imported in what order? Need a kind of topological
39
# sort of all revisions. (Or do we, can we just before doing a revision
40
# see that all its parents have either been converted or abandoned?)
34
58
from bzrlib.progress import ProgressBar
35
59
from bzrlib.atomicfile import AtomicFile
36
60
import bzrlib.trace
38
import hotshot, hotshot.stats
42
65
bzrlib.trace.enable_default_logging()
140
163
stats = hotshot.stats.load(prof_f.name)
142
165
stats.sort_stats('time')
143
## XXX: Might like to write to stderr or the trace file instead but
144
## print_stats seems hardcoded to stdout
166
# XXX: Might like to write to stderr or the trace file instead but
167
# print_stats seems hardcoded to stdout
145
168
stats.print_stats(20)