| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoids problems like:
$ be html
Traceback (most recent call last):
File "be", line 21, in <module>
sys.exit(libbe.ui.command_line.main())
File ".../libbe/ui/command_line.py", line 327, in main
ret = dispatch(ui, command, args)
File ".../libbe/ui/command_line.py", line 267, in dispatch
ret = ui.run(command, options, args)
File ".../libbe/command/base.py", line 504, in run
return command.run(options, args)
File ".../libbe/command/base.py", line 233, in run
self.status = self._run(**params)
File ".../libbe/command/html.py", line 111, in _run
html_gen.run(params['output'])
File ".../libbe/command/html.py", line 154, in run
bugs.sort()
File ".../libbe/bug.py", line 261, in __cmp__
return cmp_full(self, other)
File ".../libbe/bug.py", line 818, in __call__
val = comparison(bug_1, bug_2)
File ".../libbe/bug.py", line 750, in cmp_status
return cmp(status_index[bug_1.status], status_index[bug_2.status])
File ".../libbe/storage/util/properties.py", line 223,
in _fget
raise ValueCheckError(name, value, value_allowed_fn)
libbe.storage.util.properties.ValueCheckError: open-feature not allowed by <function <lambda> at 0x84b610c> for status
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ python test.py libbe.command.init
Doctest: libbe.command.init.Init ... FAIL
...
-----------------------
File ".../libbe/command/init.py", line 47, in libbe.command.init.Init
Failed example:
ui.run(cmd)
Exception raised:
Traceback (most recent call last):
...
File "/tmp/be.wtk/libbe/command/init.py", line 97, in _run
bd = libbe.bugdir.BugDir(storage, from_storage=False)
File "/tmp/be.wtk/libbe/bugdir.py", line 185, in __init__
self.save()
File "/tmp/be.wtk/libbe/bugdir.py", line 228, in save
self.save_settings()
File "/tmp/be.wtk/libbe/bugdir.py", line 204, in save_settings
mf = mapfile.generate(self._get_saved_settings())
File "/tmp/be.wtk/libbe/storage/util/settings_object.py", line 230, in _get_saved_settings
self, self._setting_name_to_attr_name(k))
File "/tmp/be.wtk/libbe/storage/util/properties.py", line 194, in _fget
value = fget(self)
File "/tmp/be.wtk/libbe/storage/util/properties.py", line 329, in _fget
primer(self)
File "/tmp/be.wtk/libbe/storage/util/settings_object.py", line 69, in prop_load_settings
self.load_settings()
File "/tmp/be.wtk/libbe/bugdir.py", line 194, in load_settings
self.settings = mapfile.parse(settings_mapfile)
File "/tmp/be.wtk/libbe/storage/util/mapfile.py", line 123, in parse
c = yaml.load(contents)
...
File "/usr/lib/python2.6/site-packages/yaml/reader.py", line 213, in update_raw
data = self.stream.read(size)
AttributeError: 'NoneType' object has no attribute 'read'
...
|
| |
|
| |
|
|
|
|
|
| |
Initial implementation in wking@drexel.edu-20100120192451-j206hn1s78u9a3ys
missed them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Output of
python -m cProfile -o profile be list
python -c "import pstats; p=pstats.Stats('profile'); p.sort_stats('cumulative').print_stats()"
on my slow netbook before optimization:
ncalls tottime percall cumtime percall filename:lineno(function)
10290 0.417 0.000 10.832 0.001 libbe/bugdir.py:237(uuids)
after optimization:
105 0.063 0.001 0.250 0.002 libbe/bugdir.py:237(uuids)
The old generator produced many more calls than the new
implementation, but the number of calls was not the source of the
slowdown (data not shown ;).
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This entailed a fairly thorough cleanup of libbe.util.id.
Remaining unimplemented completion helpers:
* complete_assigned()
* complete_extra_strings()
Since these would require scanning all (active?) bugs to compile
lists, and I was feeling lazy...
|
| |
|
|
|
|
|
|
| |
Also added ConnectionError pretty-print to ui.command_line, storage
version checking to BugDir.duplicate_bugdir(), and optional revision
argument to Storage.storage_version().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
duplicate_bugdir() works, but for the vcs backends, it could require
shelling out for _every_ file read. This could, and probably will, be
horribly slow. Still it works ;).
I'm not sure what a better implementation would be. The old
implementation checked out the entire earlier state into a temporary
directory
pros: single shell out, simple upgrade implementation
cons: wouldn't work well for HTTP backens
I think a good solution would run along the lines of the currently
commented out code in duplicate_bugdir(), where a
VersionedStorage.changed_since(revision)
call would give you a list of changed files. diff could work off of
that directly, without the need to generate a whole duplicate bugdir.
I'm stuck on how to handle upgrades though...
Also removed trailing whitespace from all python files.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We may already have the right type, in which case, don't mess with it.
This speeds up bugdir loading a bit more:
$ time be list > /dev/null
real 0m1.245s
user 0m1.116s
sys 0m0.124s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This flag allows us to skip unittest and testsuite declaration if we
woln't need them. It speeds up simple be calls a suprising amount.
With Testing=True (the old behavior):
wking@thor:be.wtk$ time ./be > /dev/null
real 0m0.393s
user 0m0.340s
sys 0m0.048s
With TESTING=False (the new behavior):
be.wtk$ time ./be > /dev/null
real 0m0.216s
user 0m0.152s
sys 0m0.064s
This adjustment was inspired by Jakub Wilk's Debian bug:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559295
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Protects agaist the off chance that the user doesn't have Arch (tla)
installed ;).
Changed Arch.name from "Arch" to "arch" so that each VCSs .name
matches the module name. This allows us to use vcs.VCS_ORDER (a list
of module names) to set up the allowed values of BugDir.vcs_name.
|
| |
|
|
|
|
|
|
|
|
|
| |
*.__del__() is run some unspecified time after the refcount for an
object is reduced to zero. Sometimes that means that the rest of the
world has already been deallocated, which makes life difficult,
especially when Python won't attempt to construct stack traces inside
*.__del__(). We were always (hopefully ;) calling del(*) anyway,
so we just replace those calls with *.cleanup()
|
|
|
|
| |
Also a few minor tweaks to the module imports.
|
| |
|
| |
|
|
|
|
|
| |
Also moved pre-YAML mapfile handling in mapfile.parse() into
upgrade.Upgrade_1_0_to_2._upgrade_mapfile().
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Previously:
$ be init
$ be list
...
File ".../libbe/bugdir.py", line 537, in list_uuids
for uuid in os.listdir(self.get_path("bugs")):
OSError: [Errno 2] No such file or directory: '.../.be/bugs'
|
|
|
|
|
|
|
|
| |
Also simple_bug_dir -> SimpleBugDir class, which allows me to add
utility.Dir cleanup to SimpleBugDir.cleanup().
Still having a bit of trouble with the becommand.new tests due to
bugdir loading though...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This was causing strange "RCS not found" errors in the bzr and hg
unittests. For example, the bzr tests all passed:
wking@thor:be.wtk-rr$ python test.py bzr
...
Ran 12 tests in 24.143s
OK
Except when run after the bugdir tests:
wking@thor:be.wtk-rr$ python test.py bugdir bzr
...
Ran 19 tests in 1.862s
FAILED (errors=12)
Where the failures were all
AssertionError: bzr RCS not found
Fixed by returning to intial directory after SimpleBugDirTestCase
execution. Problem is due to Python issues with unlinked directories
though, so bzr/hg will _still_ not work from unlinked directories.
This is for Python 2.5.4 on Ubuntu 8.04.3, but probably effects other
pythons too.
Details:
Isolated problem to unlinked directories:
mkdir /tmp/a
cd /tmp/a
rmdir /tmp/a
python /home/wking/src/fun/be/be.wtk-rr/test.py bzr
which fails with the same "RCS not found" errors because bzr fails:
wking@thor:/$ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; bzr --help; cd /;
rmdir: removing directory, /tmp/a
'import site' failed; use -v for traceback
bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check bzrlib is on your PYTHONPATH.
Traceback (most recent call last):
File "/usr/bin/bzr", line 64, in <module>
import bzrlib
ImportError: No module named bzrlib
which fails becase 'import site' fails:
wking@thor:/$ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; python -c 'import site'; cd /;
rmdir: removing directory, /tmp/a
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/wking/lib/python/site.py", line 73, in <module>
__boot()
File "/home/wking/lib/python/site.py", line 33, in __boot
imp.load_module('site',stream,path,descr)
File "/usr/lib/python2.5/site.py", line 408, in <module>
main()
File "/usr/lib/python2.5/site.py", line 392, in main
paths_in_sys = removeduppaths()
File "/usr/lib/python2.5/site.py", line 96, in removeduppaths
dir, dircase = makepath(dir)
File "/usr/lib/python2.5/site.py", line 72, in makepath
dir = os.path.abspath(os.path.join(*paths))
File "/usr/lib/python2.5/posixpath.py", line 403, in abspath
path = join(os.getcwd(), path)
OSError: [Errno 2] No such file or directory
which fails because our cwd doesn't exist. That makes sense ;).
Still I think Python should be able to handle it, so I reported it
http://bugs.python.org/issue6612
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In BugDir, only call bug.remove if bug.sync_with_disk==True. If it's
just in memory, automatic garbage collection is sufficient cleanup.
Comment.set_sync_with_disk() had been setting .sync_with_disk=True
regardless of the value passed in. Fixed now.
Also some minor textual adjustments.
|