Rev 5646: (jelmer) Remove obsolete scripts from tools/ (Jelmer Vernooij) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Feb 4 18:45:23 UTC 2011


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 5646 [merge]
revision-id: pqm at pqm.ubuntu.com-20110204184520-2isipxbx2s4jns5j
parent: pqm at pqm.ubuntu.com-20110204180654-fmof6mad6s3aeam1
parent: jelmer at samba.org-20110204124354-kqianp616emtamp3
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2011-02-04 18:45:20 +0000
message:
  (jelmer) Remove obsolete scripts from tools/ (Jelmer Vernooij)
removed:
  tools/convertfile.py           convertfile.py-20050630092559-ff9933170b310e5f
  tools/convertinv.py            tryconvert.py-20050630081052-197fecc07da72eb0
  tools/trace-revisions          tracerevisions-20051107162041-9dfee0a7324d206d
  tools/weavebench.py            weavebench.py-20050711054702-9c24ead29f696ede
=== removed file 'tools/convertfile.py'
--- a/tools/convertfile.py	2009-03-23 14:59:43 +0000
+++ b/tools/convertfile.py	1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
-#! /usr/bin/python
-
-# Copyright (C) 2005 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-"""Experiment in converting existing bzr branches to weaves."""
-
-
-import sys
-import bzrlib.branch
-from bzrlib.weave import Weave
-from bzrlib.weavefile import write_weave
-
-import hotshot
-import tempfile
-
-
-def convert():
-    WEAVE_NAME = "test.weave"
-
-    wf = Weave()
-
-    toconvert = sys.argv[1]
-    
-    b = bzrlib.branch.find_branch(toconvert)
-    rp = b.relpath(toconvert)
-
-    print 'converting...'
-
-    fid = b.read_working_inventory().path2id(rp)
-
-    last_lines = None
-    parents = set()
-    revno = 0
-    for rev_id in b.revision_history():
-        revno += 1
-        print revno
-        tree = b.revision_tree(rev_id)
-        inv = tree.inventory
-
-        if fid not in tree:
-            print '  (not present)'
-            continue
-
-        text = tree.get_file(fid).readlines()
-
-        if text == last_lines:
-            continue
-        last_lines = text
-        
-        weave_id = wf.add(parents, text)
-        parents = [weave_id]
-
-        print '  %4d lines' % len(text)
-
-    write_weave(wf, file(WEAVE_NAME, 'wb'))
-
-
-prof_f = tempfile.NamedTemporaryFile()
-
-prof = hotshot.Profile(prof_f.name)
-
-prof.runcall(convert) 
-prof.close()
-
-import hotshot.stats
-stats = hotshot.stats.load(prof_f.name)
-#stats.strip_dirs()
-stats.sort_stats('time')
-## XXX: Might like to write to stderr or the trace file instead but
-## print_stats seems hardcoded to stdout
-stats.print_stats(20)
-            
-

=== removed file 'tools/convertinv.py'
--- a/tools/convertinv.py	2009-03-23 14:59:43 +0000
+++ b/tools/convertinv.py	1970-01-01 00:00:00 +0000
@@ -1,75 +0,0 @@
-#! /usr/bin/python
-
-# Copyright (C) 2005 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-"""Experiment in converting existing bzr branches to weaves."""
-
-
-import bzrlib.branch
-from bzrlib.weave import Weave
-from bzrlib.weavefile import write_weave
-from bzrlib.progress import ProgressBar
-import tempfile
-import hotshot, hotshot.stats
-import sys
-
-def convert():
-    WEAVE_NAME = "inventory.weave"
-
-    pb = ProgressBar()
-
-    wf = Weave()
-
-    b = bzrlib.branch.find_branch('.')
-
-    parents = set()
-    revno = 1
-    rev_history = b.revision_history()
-    for rev_id in rev_history:
-        pb.update('converting inventory', revno, len(rev_history))
-        inv_xml = b.inventory_store[rev_id].readlines()
-        weave_id = wf.add(parents, inv_xml)
-        parents = set([weave_id])       # always just one parent
-        revno += 1
-
-    pb.update('write weave', None, None)
-    write_weave(wf, file(WEAVE_NAME, 'wb'))
-
-    pb.clear()
-
-
-def profile_convert(): 
-    prof_f = tempfile.NamedTemporaryFile()
-
-    prof = hotshot.Profile(prof_f.name)
-
-    prof.runcall(convert) 
-    prof.close()
-
-    stats = hotshot.stats.load(prof_f.name)
-    #stats.strip_dirs()
-    stats.sort_stats('time')
-    ## XXX: Might like to write to stderr or the trace file instead but
-    ## print_stats seems hardcoded to stdout
-    stats.print_stats(20)
-            
-
-if '-p' in sys.argv[1:]:
-    profile_convert()
-else:
-    convert()
-    

=== removed file 'tools/trace-revisions'
--- a/tools/trace-revisions	2007-07-17 13:47:45 +0000
+++ b/tools/trace-revisions	1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
-#! /usr/bin/env python
-
-import sys
-
-from bzrlib.branch import Branch
-
-b = Branch.open('.')
-rev_id = sys.argv[1]
-rh = []
-while True:
-    rh.append(rev_id)
-    rev = b.get_revision(rev_id)
-    if rev.parent_ids:
-        rev_id = rev.parent_ids[0]
-    else:
-        break
-rh.reverse()
-for rev_id in rh:
-    print rev_id

=== removed file 'tools/weavebench.py'
--- a/tools/weavebench.py	2009-03-23 14:59:43 +0000
+++ b/tools/weavebench.py	1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
-#! /usr/bin/python
-
-# Copyright (C) 2005 Canonical Ltd
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-"""Weave algorithms benchmark"""
-
-import bzrlib.branch
-from bzrlib.weave import Weave
-from bzrlib.weavefile import write_weave
-from bzrlib.progress import ProgressBar
-from random import randrange, randint, seed
-import tempfile
-import hotshot, hotshot.stats
-import sys
-
-WEAVE_NAME = "bench.weave"
-NUM_REVS = 2000
-
-seed(0)
-
-def build():
-    pb = ProgressBar(show_eta=False)
-
-    wf = Weave()
-    lines = []
-
-    parents = []
-    for i in xrange(NUM_REVS):
-        pb.update('building', i, NUM_REVS)
-
-        for j in range(randint(0, 4)):
-            o = randint(0, len(lines))
-            lines.insert(o, "new in version %i\n" % i)
-
-        for j in range(randint(0, 2)):
-            if lines:
-                del lines[randrange(0, len(lines))]
-
-        rev_id = wf.add("%s" % i, parents, lines)
-        parents = [rev_id]
-
-    write_weave(wf, file(WEAVE_NAME, 'wb'))
-
-        
-#     parents = set()
-#     revno = 1
-#     rev_history = b.revision_history()
-#     for rev_id in rev_history:
-#         pb.update('converting inventory', revno, len(rev_history))
-#         inv_xml = b.inventory_store[rev_id].readlines()
-#         weave_id = wf.add(parents, inv_xml)
-#         parents = set([weave_id])       # always just one parent
-#         revno += 1
-
-#     pb.update('write weave', None, None)
-#     write_weave(wf, file(WEAVE_NAME, 'wb'))
-
-    pb.clear()
-
-
-
-def profileit(fn): 
-    prof_f = tempfile.NamedTemporaryFile()
-
-    prof = hotshot.Profile(prof_f.name)
-
-    prof.runcall(fn) 
-    prof.close()
-
-    stats = hotshot.stats.load(prof_f.name)
-    #stats.strip_dirs()
-    stats.sort_stats('time')
-    ## XXX: Might like to write to stderr or the trace file instead but
-    ## print_stats seems hardcoded to stdout
-    stats.print_stats(20)
-            
-
-if '-p' in sys.argv[1:]:
-    opt_p = True
-    sys.argv.remove('-p')
-else:
-    opt_p = False
-
-if len(sys.argv) > 1:
-    NUM_REVS = int(sys.argv[1])
-
-if opt_p:
-    profileit(build)
-else:
-    build()
-    




More information about the bazaar-commits mailing list