be.git
14 years agoAdd better help message on COMMAND-less be call
W. Trevor King [Wed, 20 Jan 2010 12:19:56 +0000 (07:19 -0500)]
Add better help message on COMMAND-less be call

14 years agoAdded shortname (.id.user()) data to `be html`s comment data
W. Trevor King [Tue, 19 Jan 2010 15:46:41 +0000 (10:46 -0500)]
Added shortname (.id.user()) data to `be html`s comment data

14 years agoAllow forward slashes (/) in commit email tags in be-handle-mail.
W. Trevor King [Tue, 19 Jan 2010 15:37:31 +0000 (10:37 -0500)]
Allow forward slashes (/) in commit email tags in be-handle-mail.

Also move unitsuite definition to the end of the file so it picks up
GenerateGlobalTagsTestCase.

14 years agoFixed libbe.utuil->libbe.util typo in be-handle-mail.
W. Trevor King [Tue, 19 Jan 2010 15:09:12 +0000 (10:09 -0500)]
Fixed libbe.utuil->libbe.util typo in be-handle-mail.

Also removed some references to the old XML interface.

14 years agoUse relative paths *._vcs_* methods.
W. Trevor King [Tue, 19 Jan 2010 14:43:37 +0000 (09:43 -0500)]
Use relative paths *._vcs_* methods.

14 years agoMerged be.faster-diff branch, fixing #bea/ed5#.
W. Trevor King [Tue, 19 Jan 2010 14:10:25 +0000 (09:10 -0500)]
Merged be.faster-diff branch, fixing #bea/ed5#.

14 years agoMarked #bea/ed5# as fixed
W. Trevor King [Tue, 19 Jan 2010 14:09:42 +0000 (09:09 -0500)]
Marked #bea/ed5# as fixed

14 years agoAdjust command.serve.Serve doctest to clarify remaining test failures.
W. Trevor King [Tue, 19 Jan 2010 14:04:09 +0000 (09:04 -0500)]
Adjust command.serve.Serve doctest to clarify remaining test failures.

Current test output
  $ python test.py libbe
  ...
  FAILED (failures=1, errors=3)

All failures and errors due to unimplemented functionality

Errors:
  * Darcs._vcs_isdir() not implemented (for Darcs <= 2.3.1)
  * Arch._vcs_path() not implemented
  * Arch._vcs_changed() not implemented

Failures:
  * command.serve.Serve tests not implemented

14 years agoBetter error messages in VCS._get
W. Trevor King [Tue, 19 Jan 2010 14:02:45 +0000 (09:02 -0500)]
Better error messages in VCS._get

14 years agoWork around the extra output of `tla file-find` to get path.
W. Trevor King [Tue, 19 Jan 2010 13:59:18 +0000 (08:59 -0500)]
Work around the extra output of `tla file-find` to get path.

Example output:
  * build pristine tree for ...--patch-1
  * from import revision: ...--base-0
  * patching for revision: ...--patch-1
  ./{arch}/++pristine-trees/...--patch-1/./.be/unlikely id

14 years agoGenerate string properly in libbe.util.subproc.CommandError
W. Trevor King [Tue, 19 Jan 2010 13:48:33 +0000 (08:48 -0500)]
Generate string properly in libbe.util.subproc.CommandError

14 years agoWork around Mercurial issue618 in Arch backend.
W. Trevor King [Tue, 19 Jan 2010 13:45:04 +0000 (08:45 -0500)]
Work around Mercurial issue618 in Arch backend.

Also add some NotImplementedErrors for clearer diagnostics.

14 years agoAdded changed() support for Darcs
W. Trevor King [Mon, 18 Jan 2010 21:35:33 +0000 (16:35 -0500)]
Added changed() support for Darcs

14 years agoFix modified ID reference in libbe.diff.Diff._changed_bugs
W. Trevor King [Mon, 18 Jan 2010 19:28:10 +0000 (14:28 -0500)]
Fix modified ID reference in libbe.diff.Diff._changed_bugs

14 years agoAdd .changed support to HTTP storage backend.
W. Trevor King [Mon, 18 Jan 2010 19:22:11 +0000 (14:22 -0500)]
Add .changed support to HTTP storage backend.

Also work around urlparse.parse_qs location in Python <= 2.5.

14 years agoAdd ancestors support to HTTP storage
W. Trevor King [Mon, 18 Jan 2010 19:05:59 +0000 (14:05 -0500)]
Add ancestors support to HTTP storage

14 years agoAdd .changed() support to Hg
W. Trevor King [Mon, 18 Jan 2010 18:12:46 +0000 (13:12 -0500)]
Add .changed() support to Hg

14 years agoFix VCS doctest for +revision InvalidID error message
W. Trevor King [Mon, 18 Jan 2010 17:46:56 +0000 (12:46 -0500)]
Fix VCS doctest for +revision InvalidID error message

14 years agoAdd class name to StorageTestCase failure reporting
W. Trevor King [Mon, 18 Jan 2010 17:46:08 +0000 (12:46 -0500)]
Add class name to StorageTestCase failure reporting

14 years agoUse RevisionedBugDir, not .duplicate_bugdir() in libbe.command.diff
W. Trevor King [Mon, 18 Jan 2010 17:29:09 +0000 (12:29 -0500)]
Use RevisionedBugDir, not .duplicate_bugdir() in libbe.command.diff

14 years agoOptimized libbe.diff.Diff._changed when old bugdir is a RevisionedBugDir
W. Trevor King [Mon, 18 Jan 2010 17:27:16 +0000 (12:27 -0500)]
Optimized libbe.diff.Diff._changed when old bugdir is a RevisionedBugDir

14 years agoAdded VCS._u_find_id_from_manifest for faster id->path calculation
W. Trevor King [Mon, 18 Jan 2010 17:25:17 +0000 (12:25 -0500)]
Added VCS._u_find_id_from_manifest for faster id->path calculation

14 years agoAdjust VCSTestCase method docstrings for unittest.
W. Trevor King [Mon, 18 Jan 2010 15:12:25 +0000 (10:12 -0500)]
Adjust VCSTestCase method docstrings for unittest.

14 years agoAdded VCS._ancestors
W. Trevor King [Mon, 18 Jan 2010 15:10:30 +0000 (10:10 -0500)]
Added VCS._ancestors

14 years agoAdded Storage.ancestors
W. Trevor King [Mon, 18 Jan 2010 15:00:31 +0000 (10:00 -0500)]
Added Storage.ancestors

14 years agoMoved BugDir.duplicate_bugdir to RevisionedBugDir class
W. Trevor King [Mon, 18 Jan 2010 14:28:16 +0000 (09:28 -0500)]
Moved BugDir.duplicate_bugdir to RevisionedBugDir class

14 years agoIgnore paths with _u_path_to_id errors in VCS.changed
W. Trevor King [Mon, 18 Jan 2010 14:26:53 +0000 (09:26 -0500)]
Ignore paths with _u_path_to_id errors in VCS.changed

14 years agoAdd .changed() support to Bzr
W. Trevor King [Mon, 18 Jan 2010 13:45:16 +0000 (08:45 -0500)]
Add .changed() support to Bzr

14 years agoAdd .changed() support to Git
W. Trevor King [Mon, 18 Jan 2010 13:06:30 +0000 (08:06 -0500)]
Add .changed() support to Git

14 years agoAdd .changed() support to VCS
W. Trevor King [Mon, 18 Jan 2010 13:06:08 +0000 (08:06 -0500)]
Add .changed() support to VCS

14 years agoToo much trouble to handle Git's lack of dir versioning in test_get_previous_children
W. Trevor King [Mon, 18 Jan 2010 13:02:52 +0000 (08:02 -0500)]
Too much trouble to handle Git's lack of dir versioning in test_get_previous_children

14 years agoAdd VersionedStorageTestCases in make_versioned_storage_testcase_subclasses
W. Trevor King [Mon, 18 Jan 2010 12:53:59 +0000 (07:53 -0500)]
Add VersionedStorageTestCases in make_versioned_storage_testcase_subclasses

14 years agoAdded libbe.storage.base.VersionedStorage.changed() and a test.
W. Trevor King [Sat, 16 Jan 2010 02:30:04 +0000 (21:30 -0500)]
Added libbe.storage.base.VersionedStorage.changed() and a test.

Also converted libbe.storage.base.VersionedStorage revision ids
from integers to strings.

14 years agoUpdate setup.py to install submodules.
W. Trevor King [Fri, 15 Jan 2010 19:14:02 +0000 (14:14 -0500)]
Update setup.py to install submodules.

14 years agoMerged be.roadmap, adding dev issues #bea/ed5#, #bea/814#, and #bea/343#.
W. Trevor King [Sun, 3 Jan 2010 16:31:04 +0000 (11:31 -0500)]
Merged be.roadmap, adding dev issues #bea/ed5#, #bea/814#, and #bea/343#.

Also changed `be list --uuids` to `be list --ids`

14 years agoAdded #bea/343# : Attach tests to bugs
W. Trevor King [Sun, 3 Jan 2010 16:38:53 +0000 (11:38 -0500)]
Added #bea/343# : Attach tests to bugs

14 years agoChanged `be list --uuids` to `be list --ids`
W. Trevor King [Sun, 3 Jan 2010 16:33:56 +0000 (11:33 -0500)]
Changed `be list --uuids` to `be list --ids`

14 years agoAdded doc/distributed_bugtracking with some simple use-case notes
W. Trevor King [Sun, 3 Jan 2010 16:06:48 +0000 (11:06 -0500)]
Added doc/distributed_bugtracking with some simple use-case notes

14 years agoAdd #bea/814# : Add Roundup-like flexibility
W. Trevor King [Sun, 3 Jan 2010 16:05:57 +0000 (11:05 -0500)]
Add #bea/814# : Add Roundup-like flexibility

14 years agoAdd #bea/ed5# : Slow and ugly diff implementation
W. Trevor King [Sun, 3 Jan 2010 16:04:50 +0000 (11:04 -0500)]
Add #bea/ed5# : Slow and ugly diff implementation

14 years agoMerged be.html-storage
W. Trevor King [Fri, 1 Jan 2010 21:54:30 +0000 (16:54 -0500)]
Merged be.html-storage

Added HTTP storage backend and server
Serve a local repo on http://localhost:8000
  be --repo REPO serve
Then connect from other be calls, for example
  be --repo http://localhost:8000 list

14 years agoUpdated NEWS
W. Trevor King [Fri, 1 Jan 2010 21:54:01 +0000 (16:54 -0500)]
Updated NEWS

14 years agoFixed update_copyright.py's subproc import and updated copyrights
W. Trevor King [Fri, 1 Jan 2010 21:51:13 +0000 (16:51 -0500)]
Fixed update_copyright.py's subproc import and updated copyrights

14 years agoServe.handle_*() now raise _HandlerError so the .do_*() methods know.
W. Trevor King [Fri, 1 Jan 2010 21:55:49 +0000 (16:55 -0500)]
Serve.handle_*() now raise _HandlerError so the .do_*() methods know.

Before there wasn't a good way to tell if the handler had experienced
an error, or just didn't want to return anything.

14 years agoFixed commit handling in commands.serve and storage.http
W. Trevor King [Fri, 1 Jan 2010 21:48:03 +0000 (16:48 -0500)]
Fixed commit handling in commands.serve and storage.http

14 years agoUse more kwargs in libbe.command.serve
W. Trevor King [Fri, 1 Jan 2010 21:33:39 +0000 (16:33 -0500)]
Use more kwargs in libbe.command.serve

kwargs make things easier to maintain.

Also make sure the .handle_*() methods return two items
  (content,ctype)
even when both are None.

14 years agoImproved POST and error handling in `be serve`
W. Trevor King [Fri, 1 Jan 2010 21:11:48 +0000 (16:11 -0500)]
Improved POST and error handling in `be serve`

POST handling:

Drop the cgi.FieldStorage() in favor of the old urlparse.parse_qs().
We need a dictionary, which FieldStorage is not.  However, I added
.read_post_data() since my old self.rfile.read() was hanging.  The
read_post_data() implementation comes from the
FieldStorage.__init__().

Error handling:

wrap .handle_*() blocks in try/except to handle Storage errors

14 years agoFixed some stupid typos in libbe/storage/http.py
W. Trevor King [Fri, 1 Jan 2010 21:10:45 +0000 (16:10 -0500)]
Fixed some stupid typos in libbe/storage/http.py

14 years agoImproved POST parsing, fixed Serve._long_help(), added --read-only.
W. Trevor King [Fri, 1 Jan 2010 20:33:23 +0000 (15:33 -0500)]
Improved POST parsing, fixed Serve._long_help(), added --read-only.

POST parsing via cgi.FieldStorage from Doug Hellmann's
  http://blog.doughellmann.com/2007/12/pymotw-basehttpserver.html

14 years agoAdded libbe.command.serve and libbe.storage.http for HTTP backend.
W. Trevor King [Fri, 1 Jan 2010 19:43:03 +0000 (14:43 -0500)]
Added libbe.command.serve and libbe.storage.http for HTTP backend.

Now the following works:
  some-BE-dir$ ./be serve
  $ ./be --repo http://localhost:8000 list

I haven't come up with a clean idea for testing this yet, so other
commands may be broken, but once we get the testing working, it
shouldn't be too hard to get everything working over HTTP :).

14 years agoHand nonexistent paths in VCS._u_search_parent_directories().
W. Trevor King [Fri, 1 Jan 2010 19:41:01 +0000 (14:41 -0500)]
Hand nonexistent paths in VCS._u_search_parent_directories().

search_parent_directries raises an AssertionError if the original path
doesn't exist.

14 years agoReturn a meaningful Storage.version()
W. Trevor King [Fri, 1 Jan 2010 15:46:23 +0000 (10:46 -0500)]
Return a meaningful Storage.version()

14 years agoUpdated copyright information
W. Trevor King [Fri, 1 Jan 2010 13:11:08 +0000 (08:11 -0500)]
Updated copyright information

14 years agoMerged be.restructure, major internal reorganization.
W. Trevor King [Thu, 31 Dec 2009 20:54:12 +0000 (15:54 -0500)]
Merged be.restructure, major internal reorganization.

Added a bunch of classes to make the commands, user interfaces, and
storage backends more abstract and distinct.  This should make it much
easier to extend and maintain BE.

Features:
 * Directory restructured:
   becommands/ -> libbe/commands
   submods sorted by functionality.
 * Lots of new classes:
   Option, Argument, Command
   InputOutput, StorageCallbacks, UserInterface
   Storage
 * Consolidated ID handling in libbe.util.id
 * Transitioned VCS backends for Python-based VCSs from subprocess
   calss to internal python calls.

Plus the user-visible changes:
 * New bugdir/bug/comment ID format replaces old bug:comment format.
 * Deprecated support for `be diff` on Arch and Darcs <= 2.3.1.  A new
   backend abstraction (Storage) makes the former implementation
   ungainly.
 * Improved command completion.
 * Removed commands close, open, email_bugs,
 * Flipped some arguments
   `be assign BUG-ID [ASSIGNEE]` -> `be status ASSIGNED BUG-ID ...`
   `be severity BUG-ID SEVERITY` -> `be severity SEVERITY BUG-ID ...`
   `be status BUG-ID STATUS` -> `be status STATUS BUG-ID ...`

In the merge:
  * Added 'commit' to list of pagerless commands.
  * Updated doc/README.dev

See
#bea86499-824e-4e77-b085-2d581fa9ccab/1100c966-9671-4bc6-8b68-6d408a910da1#
for a discussion of why the changes were made and some of the
difficulties en-route.

14 years agoUse fragment in base command completion + command io fixups.
W. Trevor King [Thu, 31 Dec 2009 20:33:39 +0000 (15:33 -0500)]
Use fragment in base command completion + command io fixups.

14 years agoUpdated NEWS and closed #bea/110#
W. Trevor King [Thu, 31 Dec 2009 19:49:58 +0000 (14:49 -0500)]
Updated NEWS and closed #bea/110#

14 years agoBrought be-handle-mail up to date
W. Trevor King [Thu, 31 Dec 2009 19:33:30 +0000 (14:33 -0500)]
Brought be-handle-mail up to date

14 years agoAdded UserInterface and other improved abstractions for command handling
W. Trevor King [Thu, 31 Dec 2009 19:32:39 +0000 (14:32 -0500)]
Added UserInterface and other improved abstractions for command handling

14 years agoBetter import error messages in test.py
W. Trevor King [Thu, 31 Dec 2009 17:36:29 +0000 (12:36 -0500)]
Better import error messages in test.py

14 years agoTrack connection status to allow multiple Storage.disconnect() calls.
W. Trevor King [Thu, 31 Dec 2009 16:47:33 +0000 (11:47 -0500)]
Track connection status to allow multiple Storage.disconnect() calls.

This makes cleaning up UIs easier: just call disconnect() :p.

14 years agoRemoved libbe/ui/base.py. Basic UI definitions are in libbe/command/base.py.
W. Trevor King [Thu, 31 Dec 2009 11:51:27 +0000 (06:51 -0500)]
Removed libbe/ui/base.py.  Basic UI definitions are in libbe/command/base.py.

14 years agoEmptied interfaces directory
W. Trevor King [Wed, 30 Dec 2009 02:53:58 +0000 (21:53 -0500)]
Emptied interfaces directory

Mostly throwing out a bunch of outdated GUIs.  The email interface
hasn't been moved over to the new 'Command' format yet...

14 years agoCorrect for possible directory changes in mercurial.dispatch.dispatch()
W. Trevor King [Wed, 30 Dec 2009 02:37:14 +0000 (21:37 -0500)]
Correct for possible directory changes in mercurial.dispatch.dispatch()

I ran across this when the hg unittests broke the vcs.base unittests:
  $ python test.py libbe.storage.vcs.base libbe.storage.vcs.hg
  ...
  OK
  $ python test.py libbe.storage.vcs.hg libbe.storage.vcs.base
  ...
  File ".../libbe/storage/vcs/base.py", line 914, in libbe.storage.vcs.base.VCSTestCase.Class._u_rel_path
  Failed example:
      vcs._u_rel_path("./a", ".")
  Exception raised:
      Traceback (most recent call last):
        File "/usr/lib/python2.5/doctest.py", line 1228, in __run
          compileflags, 1) in test.globs
        File "<doctest libbe.storage.vcs.base.VCSTestCase.Class._u_rel_path[4]>", line 1, in <module>
          vcs._u_rel_path("./a", ".")
        File ".../libbe/storage/vcs/base.py", line 921, in _u_rel_path
          path = os.path.abspath(path)
        File "/usr/lib/python2.5/posixpath.py", line 403, in abspath
          path = join(os.getcwd(), path)
      OSError: [Errno 2] No such file or directory
  ...
  FAILED (failures=1)

14 years agoDisable mercurial.demandimport, since it breaks Bzr
W. Trevor King [Wed, 30 Dec 2009 02:25:33 +0000 (21:25 -0500)]
Disable mercurial.demandimport, since it breaks Bzr

Running
  python test.py libbe.storage.vcs.hg libbe.storage.vcs.bzr
with the old setup produced lots of
  Traceback (most recent call last):
    File ".../libbe/storage/vcs/base.py", line 1010, in setUp
      self.s.init()
    File ".../libbe/storage/base.py", line 170, in init
      return self._init()
    File ".../libbe/storage/vcs/base.py", line 664, in _init
      self._vcs_init(self.repo)
    File ".../libbe/storage/vcs/bzr.py", line 88, in _vcs_init
      cmd.run(location=path)
    File ".../python2.5/site-packages/bzrlib/builtins.py", line 1685, in run
      format = bzrdir.format_registry.make_bzrdir('default')
    File ".../python2.5/site-packages/bzrlib/bzrdir.py", line 3452, in make_bzrdir
      return self.get(key)()
    File ".../python2.5/site-packages/bzrlib/bzrdir.py", line 3398, in helper
      bd.set_branch_format(_load(branch_format))
    File ".../python2.5/site-packages/bzrlib/bzrdir.py", line 3385, in _load
      [factory_name])
    File "/var/lib/python-support/python2.5/mercurial/demandimport.py", line 108, in _demandimport
      setattr(mod, x, _demandmod(x, mod.__dict__, locals))
    File ".../python2.5/site-packages/bzrlib/lazy_import.py", line 106, in __getattribute__
      obj = _replace()
    File ".../python2.5/site-packages/bzrlib/lazy_import.py", line 88, in _replace
      extra=e)
  IllegalUseOfScopeReplacer: ScopeReplacer object 'branch' was used incorrectly: Object already cleaned up, did you assign it to another variable?: _factory

14 years agoUse ._vcs_is_versioned() in VCS._children()
W. Trevor King [Wed, 30 Dec 2009 02:17:39 +0000 (21:17 -0500)]
Use ._vcs_is_versioned() in VCS._children()

Otherwise Arch will return '.arch-ids' in its list, etc.

14 years agoFixed make_*_testcase_subclasses() to avoid duplication.
W. Trevor King [Wed, 30 Dec 2009 02:12:12 +0000 (21:12 -0500)]
Fixed make_*_testcase_subclasses() to avoid duplication.

Also removed final check for 'parent' existence in
  Storage_add_remove_TestCase.test_remove_nonrooted()
because some VCSs (e.g. Git) don't keep track of blank directories.

14 years agoWe don't do much with Mercurial's ui, so _dispatch -> dispatch
W. Trevor King [Wed, 30 Dec 2009 01:13:43 +0000 (20:13 -0500)]
We don't do much with Mercurial's ui, so _dispatch -> dispatch

14 years agoDon't chdir() in libbe/command/html.py doctests.
W. Trevor King [Wed, 30 Dec 2009 01:06:27 +0000 (20:06 -0500)]
Don't chdir() in libbe/command/html.py doctests.

14 years agoDon't worry about whitespace in `be --help`
W. Trevor King [Wed, 30 Dec 2009 00:53:13 +0000 (19:53 -0500)]
Don't worry about whitespace in `be --help`

14 years agoRemove libbe.ui.util.cmdutil
W. Trevor King [Wed, 30 Dec 2009 00:49:50 +0000 (19:49 -0500)]
Remove libbe.ui.util.cmdutil

All of its functionality has moved off into more focused modules.

14 years agoPropogate long_to_short_user() -> long_to_short_text() and inverse
W. Trevor King [Wed, 30 Dec 2009 00:48:33 +0000 (19:48 -0500)]
Propogate long_to_short_user() -> long_to_short_text() and inverse

I'd missed some calls when I made the changes.

14 years agoRestored post-colon spaces in doctests
W. Trevor King [Wed, 30 Dec 2009 00:19:15 +0000 (19:19 -0500)]
Restored post-colon spaces in doctests

14 years agoFixed up the completion helpers in libbe.command.util
W. Trevor King [Wed, 30 Dec 2009 00:00:40 +0000 (19:00 -0500)]
Fixed up the completion helpers in libbe.command.util

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...

14 years agoCommented #bea/110/781# on why I'm not supporting Arch.child(revision)
W. Trevor King [Tue, 29 Dec 2009 16:28:40 +0000 (11:28 -0500)]
Commented #bea/110/781# on why I'm not supporting Arch.child(revision)

14 years agoUpdated Darcs backend towards supporting .children(revision).
W. Trevor King [Tue, 29 Dec 2009 15:39:09 +0000 (10:39 -0500)]
Updated Darcs backend towards supporting .children(revision).

._vcs_isdir() and ._vcs_listdir() will need to parse the output of
  darcs show files [options] --patch REVISION PATH
but both the --patch option and the PATH argument are new, and I can't
get a recent enough version of Darcs to compile on my system.
Theoretically they will work, but they remain untested for now.

I don't think it's worth rolling my own
  darcs show files --patch REVISION
to support earlier versions of Darcs, since the only solution I can
think of now would be to check out the given revision and use
os.walk() or some such, and that would be really ugly...

Also added .version_cmp() for easy version comparison.

Reindented ._vcs_get_file_contents() to remove trailing elses since
the if clauses all contain returns.

14 years agoAdded an additional VCS._u_rel_path() unittest.
W. Trevor King [Tue, 29 Dec 2009 15:18:20 +0000 (10:18 -0500)]
Added an additional VCS._u_rel_path() unittest.

Also re-enabled the unitsuite in libbe.storage.vcs.base, which
I'd disabled while testing the VCS unittests.

14 years agoAdded root directory handling to VCS._u_rel_path().
W. Trevor King [Tue, 29 Dec 2009 14:46:59 +0000 (09:46 -0500)]
Added root directory handling to VCS._u_rel_path().

Now it returns '.' when you ask for the relative path from root to
itself.  It used to raise AssertionError or InvalidPath.

14 years agoAdjust Git._vcs_isdir() to Python-2.5-compatible syntax
W. Trevor King [Tue, 29 Dec 2009 11:40:38 +0000 (06:40 -0500)]
Adjust Git._vcs_isdir() to Python-2.5-compatible syntax

14 years agoUpdated Hg backend to support .children(revision).
W. Trevor King [Tue, 29 Dec 2009 11:36:23 +0000 (06:36 -0500)]
Updated Hg backend to support .children(revision).

14 years agoHg storage now based off mercurial module, not 'hg' executible.
W. Trevor King [Tue, 29 Dec 2009 10:52:27 +0000 (05:52 -0500)]
Hg storage now based off mercurial module, not 'hg' executible.

This should make repeated calls to Hg storage instances _much_ faster,
since we avoid repeatedly loading and tearing down a python subprocess.
For example, the testsuite runs ~6x faster on my box.

Here's a run with the old Hg implementation:
  $ python test.py libbe.storage.vcs.hg
  ...
  =================================
  ERROR: test_get_previous_children
  ---------------------------------
  Traceback (most recent call last):
    ...
  NotImplementedError

  ---------------------------------
  Ran 49 tests in 133.285s

  FAILED (errors=1)

A run with the new implementation gives the same results, except for:
  Ran 49 tests in 22.328s

14 years agoAdapted BugDir.duplicate_bugdir() to use revision-dependend Storage.children()
W. Trevor King [Tue, 29 Dec 2009 09:43:42 +0000 (04:43 -0500)]
Adapted BugDir.duplicate_bugdir() to use revision-dependend Storage.children()

14 years agoUpdated Git backend to support .children(revision).
W. Trevor King [Mon, 28 Dec 2009 18:22:27 +0000 (13:22 -0500)]
Updated Git backend to support .children(revision).

+ some minor fixes to vcs/base.py and vcs/bzr.py

Also removed .be/id-cache, which should never have been versioned in
the first place.

14 years agoFixed VCS.children() and Bzr.children() for non-None revisions.
W. Trevor King [Mon, 28 Dec 2009 17:30:19 +0000 (12:30 -0500)]
Fixed VCS.children() and Bzr.children() for non-None revisions.

Now they both pass
  VersionedStorage_commit_TestCase.test_commit_revision_ids()

The .children() implementation for previous revisions lacks the
working directory's id<->path cache, so it's fairly slow...

14 years agoAdded VersionedStorage_commit_TestCase.test_commit_revision_ids()
W. Trevor King [Mon, 28 Dec 2009 16:13:49 +0000 (11:13 -0500)]
Added VersionedStorage_commit_TestCase.test_commit_revision_ids()

14 years agoAllow external use of Command.usage() and use CmdOptionParser.set_usage()
W. Trevor King [Mon, 28 Dec 2009 15:56:04 +0000 (10:56 -0500)]
Allow external use of Command.usage() and use CmdOptionParser.set_usage()

This fixes
  $ python be diff -2
  Usage: be [options]

  be: error: no such option: -2
and we now get the correct output
  $ python be diff -2
  Usage: be diff [options] [REVISION]

  be: error: no such option: -2

14 years agoRestore comment stripping to libbe.ui.util.editor.editor_string()
W. Trevor King [Mon, 28 Dec 2009 15:40:48 +0000 (10:40 -0500)]
Restore comment stripping to libbe.ui.util.editor.editor_string()

14 years agoBzr storage now based off bzrlib module, not 'bzr' executible.
W. Trevor King [Mon, 28 Dec 2009 15:28:58 +0000 (10:28 -0500)]
Bzr storage now based off bzrlib module, not 'bzr' executible.

This should make repeated calls to Bzr storage instances _much_ faster,
since we avoid repeatedly loading and tearing down a python subprocess.

14 years agoVersionedStorage_commit_TestCase now allows for versioned files created by self.s...
W. Trevor King [Mon, 28 Dec 2009 15:24:57 +0000 (10:24 -0500)]
VersionedStorage_commit_TestCase now allows for versioned files created by self.s.init()

14 years agolibbe.storage.vcs.base.VCS._init() now creates the '.be/version' file.
W. Trevor King [Mon, 28 Dec 2009 15:06:40 +0000 (10:06 -0500)]
libbe.storage.vcs.base.VCS._init() now creates the '.be/version' file.

And
  python test.py libbe.storage.vcs.base
passes again.

14 years agoAdd most comments with ignore_missing_references=True.
W. Trevor King [Mon, 28 Dec 2009 12:10:47 +0000 (07:10 -0500)]
Add most comments with ignore_missing_references=True.

14 years agoDon't run pager for the 'comment' command.
W. Trevor King [Mon, 28 Dec 2009 12:09:18 +0000 (07:09 -0500)]
Don't run pager for the 'comment' command.

It may need access to the tty for the spawned editor.

14 years agoMoved InvalidStorageVersion from libbe.command to libbe.storage
W. Trevor King [Sun, 27 Dec 2009 21:50:36 +0000 (16:50 -0500)]
Moved InvalidStorageVersion from libbe.command to libbe.storage

Also added ConnectionError pretty-print to ui.command_line, storage
version checking to BugDir.duplicate_bugdir(), and optional revision
argument to Storage.storage_version().

14 years agoAdded storage.Storage.storage_version() and command.InvalidStorageVersion.
W. Trevor King [Sun, 27 Dec 2009 21:30:54 +0000 (16:30 -0500)]
Added storage.Storage.storage_version() and command.InvalidStorageVersion.

Now commands automatically check for storage version compatibility.

14 years agoFixed libbe.storage.util.upgrade
W. Trevor King [Sun, 27 Dec 2009 20:58:29 +0000 (15:58 -0500)]
Fixed libbe.storage.util.upgrade

Note that it only upgrades on-disk versions, so you can't use a
non-VCS storage backend whose version isn't your command's current
storage version.  See #bea/110/bd1# for reasoning.  To see the on-disk
storage version, look at
  .be/version
To see your command's supported storage version, look at
  be --full-version

I added test_upgrade.sh to exercise the upgrade mechanism on BE's own
repository.

14 years agoFixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementation
W. Trevor King [Tue, 15 Dec 2009 11:44:20 +0000 (06:44 -0500)]
Fixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementation

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.

14 years agoFixed libbe.command.subscribe
W. Trevor King [Tue, 15 Dec 2009 09:32:19 +0000 (04:32 -0500)]
Fixed libbe.command.subscribe

14 years agoFixed up libbe.diff
W. Trevor King [Tue, 15 Dec 2009 08:57:54 +0000 (03:57 -0500)]
Fixed up libbe.diff

14 years agoTransition to Command-format complete.
W. Trevor King [Tue, 15 Dec 2009 08:31:48 +0000 (03:31 -0500)]
Transition to Command-format complete.

Well, except for going through and updating the _long_help()
strings.
  $ python test.py libbe.command
succeeds for everything except Diff and Subscribe, which is expected
since I haven't fixed up libbe.diff yet.

14 years agoTransitioned set to Command-format
W. Trevor King [Tue, 15 Dec 2009 08:05:34 +0000 (03:05 -0500)]
Transitioned set to Command-format

14 years agoTransitioned target to Command-format
W. Trevor King [Tue, 15 Dec 2009 07:38:51 +0000 (02:38 -0500)]
Transitioned target to Command-format