~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Aaron Bentley
  • Date: 2007-04-14 07:23:54 UTC
  • mto: (2520.4.1 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: aaron.bentley@utoronto.ca-20070414072354-8g2awkl9xgkdkx3h
merge changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
            vf.import_versionedfile(file_weave, to_sync, single_parent=single,
79
79
                                    verify=verify, no_cache=not cache)
80
80
            if size:
81
 
                snapshots = vf.select_by_size(len(snapshots))
 
81
                snapshots = vf.select_by_size(len(old_snapshots))
82
82
                for version_id in snapshots:
83
83
                    vf.make_snapshot(version_id)
84
84
            if build:
85
85
                ranking = vf.get_build_ranking()
86
 
                snapshots = ranking[:len(snapshots) -\
 
86
                snapshots = ranking[:len(old_snapshots) -\
87
87
                    len(vf._snapshots)]
88
88
                for version_id in snapshots:
89
 
                    old_len = len(vf._snapshots)
90
 
                    #vf.make_snapshot(version_id)
 
89
                    vf.make_snapshot(version_id)
91
90
        except:
92
91
            vf.destroy()
93
92
            raise
98
97
            if memory:
99
98
                if outfile is not None:
100
99
                    vf_file = MultiVersionedFile(outfile)
101
 
                for version_id in vf.versions():
102
 
                    vf_file.add_diff(vf.get_diff(version_id), version_id,
103
 
                                     vf._parents[version_id])
 
100
                vf_file.import_diffs(vf)
104
101
            else:
105
102
                vf_file = vf
106
103
        finally:
110
107
                vf_file.save()
111
108
 
112
109
class cmd_mp_extract(commands.Command):
 
110
    """Test extraction time multiparent knits"""
113
111
 
114
112
    takes_options = [
115
113
        commands.Option('lsprof-timed', help='Use lsprof'),
123
121
            parallel=False):
124
122
        vf = MultiVersionedFile(filename)
125
123
        vf.load()
 
124
        snapshots = [r for r in vf.versions() if vf.get_diff(r).is_snapshot()]
 
125
        print '%d snapshots' % len(snapshots)
126
126
        revisions = list(vf.versions())
127
127
        revisions = revisions[-count:]
128
128
        print 'Testing extract time of %d revisions' % len(revisions)