From d7e4f9a09ffee3d248f5cc4be3cd4248a5c97af4 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Thu, 17 Mar 2005 21:29:00 +0000 Subject: [PATCH] Switched tree format to mapfile-based --- .../creator | 1 - .../0e0c806c-5443-4839-aa60-9615c8c10853/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../2aa60b34-2c8d-4f41-bb97-a57309523262/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../3613e6e9-db9e-4775-8914-f31f0b4b81ac/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../73a767f4-75e7-4cde-9e24-91bff99ab428/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../74cccfbf-069d-4e99-8cab-adaa35f9a2eb/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../7ba4bc51-b251-483a-a67a-f1b89c83f6af/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../creator | 1 - .../ee681951-f254-43d3-a53a-1b36ae415d5c/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .../f51dc5a7-37b7-4ce1-859a-b7cb58be6494/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../target | 1 - .../values | 28 +++++ .../creator | 1 - .../f65b680b-4309-43a2-ae2d-e65811c9d107/name | 1 - .../severity | 1 - .../status | 1 - .../summary | 1 - .../values | 28 +++++ .be/version | 2 +- becommands/close.py | 4 +- becommands/new.py | 2 +- becommands/open.py | 1 + becommands/severity.py | 1 + becommands/upgrade.py | 86 ++++++++++++++ libbe/bugdir.py | 96 ++++++++------- libbe/mapfile.py | 110 ++---------------- libbe/rcs.py | 8 +- 75 files changed, 474 insertions(+), 199 deletions(-) delete mode 100644 .be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/creator delete mode 100644 .be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/name delete mode 100644 .be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/severity delete mode 100644 .be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/status delete mode 100644 .be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/summary create mode 100644 .be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/values delete mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator delete mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name delete mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity delete mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status delete mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary create mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values delete mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator delete mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name delete mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity delete mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status delete mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary create mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/values delete mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator delete mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name delete mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity delete mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status delete mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary create mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/values delete mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator delete mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name delete mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity delete mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status delete mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary create mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values delete mode 100644 .be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/creator delete mode 100644 .be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/name delete mode 100644 .be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/severity delete mode 100644 .be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/status delete mode 100644 .be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/summary create mode 100644 .be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/values delete mode 100644 .be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/creator delete mode 100644 .be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/name delete mode 100644 .be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/severity delete mode 100644 .be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/status delete mode 100644 .be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/summary create mode 100644 .be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/values delete mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator delete mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name delete mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity delete mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status delete mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary create mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/values delete mode 100644 .be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/creator delete mode 100644 .be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/name delete mode 100644 .be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/severity delete mode 100644 .be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/status delete mode 100644 .be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/summary create mode 100644 .be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/values delete mode 100644 .be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/name delete mode 100644 .be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/severity delete mode 100644 .be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/status delete mode 100644 .be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/summary delete mode 100644 .be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/target create mode 100644 .be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/values delete mode 100644 .be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/creator delete mode 100644 .be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/name delete mode 100644 .be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/severity delete mode 100644 .be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/status delete mode 100644 .be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/summary create mode 100644 .be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/values create mode 100644 becommands/upgrade.py diff --git a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/creator b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/name b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/name deleted file mode 100644 index d213809..0000000 --- a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/name +++ /dev/null @@ -1 +0,0 @@ -abentley-4 diff --git a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/severity b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/status b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/status deleted file mode 100644 index 1ac2082..0000000 --- a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/status +++ /dev/null @@ -1 +0,0 @@ -closed diff --git a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/summary b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/summary deleted file mode 100644 index cead127..0000000 --- a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/summary +++ /dev/null @@ -1 +0,0 @@ -fix up command listings diff --git a/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/values b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/values new file mode 100644 index 0000000..26c2c47 --- /dev/null +++ b/.be/bugs/0e0c806c-5443-4839-aa60-9615c8c10853/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=fix up command listings + + + diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name deleted file mode 100644 index d213809..0000000 --- a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name +++ /dev/null @@ -1 +0,0 @@ -abentley-4 diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status deleted file mode 100644 index f510327..0000000 --- a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status +++ /dev/null @@ -1 +0,0 @@ -open diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary deleted file mode 100644 index 1cf46cb..0000000 --- a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary +++ /dev/null @@ -1 +0,0 @@ -implement message-change log diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values new file mode 100644 index 0000000..402cd43 --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=implement message-change log + + + diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name deleted file mode 100644 index a39c86e..0000000 --- a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name +++ /dev/null @@ -1 +0,0 @@ -abentley-3 diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status deleted file mode 100644 index 1ac2082..0000000 --- a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status +++ /dev/null @@ -1 +0,0 @@ -closed diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary deleted file mode 100644 index 4c17f24..0000000 --- a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary +++ /dev/null @@ -1 +0,0 @@ -auto-add files to revision control diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/values b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/values new file mode 100644 index 0000000..f9e418d --- /dev/null +++ b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=auto-add files to revision control + + + diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name deleted file mode 100644 index d213809..0000000 --- a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name +++ /dev/null @@ -1 +0,0 @@ -abentley-4 diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status deleted file mode 100644 index f510327..0000000 --- a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status +++ /dev/null @@ -1 +0,0 @@ -open diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary deleted file mode 100644 index 2cb4148..0000000 --- a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary +++ /dev/null @@ -1 +0,0 @@ -implement severity on bug creation diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/values b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/values new file mode 100644 index 0000000..2971ab4 --- /dev/null +++ b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=implement severity on bug creation + + + diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name deleted file mode 100644 index d213809..0000000 --- a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name +++ /dev/null @@ -1 +0,0 @@ -abentley-4 diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity deleted file mode 100644 index 92f7828..0000000 --- a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity +++ /dev/null @@ -1 +0,0 @@ -serious diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status deleted file mode 100644 index f510327..0000000 --- a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status +++ /dev/null @@ -1 +0,0 @@ -open diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary deleted file mode 100644 index 682e915..0000000 --- a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary +++ /dev/null @@ -1 +0,0 @@ -implement comments diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values new file mode 100644 index 0000000..87b202b --- /dev/null +++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=serious + + + + + + +status=open + + + + + + +summary=implement comments + + + diff --git a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/creator b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/name b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/name deleted file mode 100644 index d8dfad2..0000000 --- a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/name +++ /dev/null @@ -1 +0,0 @@ -abentley-2 diff --git a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/severity b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/status b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/status deleted file mode 100644 index 1ac2082..0000000 --- a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/status +++ /dev/null @@ -1 +0,0 @@ -closed diff --git a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/summary b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/summary deleted file mode 100644 index 5ac52ed..0000000 --- a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/summary +++ /dev/null @@ -1 +0,0 @@ -Can't close bugs diff --git a/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/values b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/values new file mode 100644 index 0000000..93689fb --- /dev/null +++ b/.be/bugs/74cccfbf-069d-4e99-8cab-adaa35f9a2eb/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=Can't close bugs + + + diff --git a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/creator b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/name b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/name deleted file mode 100644 index 25d556f..0000000 --- a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/name +++ /dev/null @@ -1 +0,0 @@ -abentley-5 diff --git a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/severity b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/severity deleted file mode 100644 index 92f7828..0000000 --- a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/severity +++ /dev/null @@ -1 +0,0 @@ -serious diff --git a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/status b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/status deleted file mode 100644 index f510327..0000000 --- a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/status +++ /dev/null @@ -1 +0,0 @@ -open diff --git a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/summary b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/summary deleted file mode 100644 index 8fbde94..0000000 --- a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/summary +++ /dev/null @@ -1 +0,0 @@ -Add test cases diff --git a/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/values b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/values new file mode 100644 index 0000000..77865bd --- /dev/null +++ b/.be/bugs/7ba4bc51-b251-483a-a67a-f1b89c83f6af/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=serious + + + + + + +status=open + + + + + + +summary=Add test cases + + + diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name deleted file mode 100644 index d213809..0000000 --- a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name +++ /dev/null @@ -1 +0,0 @@ -abentley-4 diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status deleted file mode 100644 index 1ac2082..0000000 --- a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status +++ /dev/null @@ -1 +0,0 @@ -closed diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary deleted file mode 100644 index b3ce992..0000000 --- a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary +++ /dev/null @@ -1 +0,0 @@ -prevent collisions in different branches diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/values b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/values new file mode 100644 index 0000000..1655f99 --- /dev/null +++ b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=prevent collisions in different branches + + + diff --git a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/creator b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/name b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/name deleted file mode 100644 index ff6baa3..0000000 --- a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/name +++ /dev/null @@ -1 +0,0 @@ -abentley-6 diff --git a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/severity b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/status b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/status deleted file mode 100644 index f510327..0000000 --- a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/status +++ /dev/null @@ -1 +0,0 @@ -open diff --git a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/summary b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/summary deleted file mode 100644 index 72d1ca0..0000000 --- a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/summary +++ /dev/null @@ -1 +0,0 @@ -Support rcs configuration diff --git a/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/values b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/values new file mode 100644 index 0000000..2e99d0c --- /dev/null +++ b/.be/bugs/ee681951-f254-43d3-a53a-1b36ae415d5c/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=open + + + + + + +summary=Support rcs configuration + + + diff --git a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/name b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/name deleted file mode 100644 index 49529a8..0000000 --- a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/name +++ /dev/null @@ -1 +0,0 @@ -abentley-1 diff --git a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/severity b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/severity deleted file mode 100644 index b042ed3..0000000 --- a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/severity +++ /dev/null @@ -1 +0,0 @@ -fatal diff --git a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/status b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/status deleted file mode 100644 index 1ac2082..0000000 --- a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/status +++ /dev/null @@ -1 +0,0 @@ -closed diff --git a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/summary b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/summary deleted file mode 100644 index 1c2d1a3..0000000 --- a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/summary +++ /dev/null @@ -1 +0,0 @@ -Can't create bugs diff --git a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/target b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/target deleted file mode 100644 index 49d5957..0000000 --- a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/target +++ /dev/null @@ -1 +0,0 @@ -0.1 diff --git a/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/values b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/values new file mode 100644 index 0000000..87a5ca5 --- /dev/null +++ b/.be/bugs/f51dc5a7-37b7-4ce1-859a-b7cb58be6494/values @@ -0,0 +1,28 @@ + + + +severity=fatal + + + + + + +status=closed + + + + + + +summary=Can't create bugs + + + + + + +target=0.1 + + + diff --git a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/creator b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/creator deleted file mode 100644 index ce73549..0000000 --- a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/creator +++ /dev/null @@ -1 +0,0 @@ -abentley diff --git a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/name b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/name deleted file mode 100644 index 8bd84e0..0000000 --- a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/name +++ /dev/null @@ -1 +0,0 @@ -abentley-7 diff --git a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/severity b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/severity deleted file mode 100644 index acb503f..0000000 --- a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/severity +++ /dev/null @@ -1 +0,0 @@ -minor diff --git a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/status b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/status deleted file mode 100644 index 1ac2082..0000000 --- a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/status +++ /dev/null @@ -1 +0,0 @@ -closed diff --git a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/summary b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/summary deleted file mode 100644 index 5bf0173..0000000 --- a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/summary +++ /dev/null @@ -1 +0,0 @@ -friendly name is created, but not used diff --git a/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/values b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/values new file mode 100644 index 0000000..e73c0b8 --- /dev/null +++ b/.be/bugs/f65b680b-4309-43a2-ae2d-e65811c9d107/values @@ -0,0 +1,28 @@ + + + +creator=abentley + + + + + + +severity=minor + + + + + + +status=closed + + + + + + +summary=friendly name is created, but not used + + + diff --git a/.be/version b/.be/version index 25c1c63..990837e 100644 --- a/.be/version +++ b/.be/version @@ -1 +1 @@ -Bugs Everywhere Tree 0 0 +Bugs Everywhere Tree 1 0 diff --git a/becommands/close.py b/becommands/close.py index 11c5c74..2344a90 100644 --- a/becommands/close.py +++ b/becommands/close.py @@ -2,4 +2,6 @@ from libbe import cmdutil def execute(args): assert(len(args) == 1) - cmdutil.get_bug(args[0]).status = "closed" + bug = cmdutil.get_bug(args[0]) + bug.status = "closed" + bug.save() diff --git a/becommands/new.py b/becommands/new.py index 284f730..eae9688 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -10,5 +10,5 @@ def execute(args): bug.severity = "minor" bug.status = "open" bug.summary = args[0] - + bug.save() diff --git a/becommands/open.py b/becommands/open.py index bd0e4fa..dd50f93 100644 --- a/becommands/open.py +++ b/becommands/open.py @@ -4,3 +4,4 @@ def execute(args): assert(len(args) == 1) bug = cmdutil.get_bug(args[0]) bug.status = "open" + bug.save() diff --git a/becommands/severity.py b/becommands/severity.py index a421dd2..0b35c50 100644 --- a/becommands/severity.py +++ b/becommands/severity.py @@ -18,6 +18,7 @@ def execute(args): if e.name != "severity": raise raise cmdutil.UserError ("Invalid severity level: %s" % e.value) + bug.save() def help(): diff --git a/becommands/upgrade.py b/becommands/upgrade.py new file mode 100644 index 0000000..2d2c242 --- /dev/null +++ b/becommands/upgrade.py @@ -0,0 +1,86 @@ +""" Upgrade the bugs to the latest format """ +import os.path +import errno +from libbe import bugdir, rcs + +def execute(args): + root = bugdir.tree_root(".", old_version=True) + for uuid in root.list_uuids(): + old_bug = OldBug(root.bugs_path, uuid) + + new_bug = bugdir.Bug(root.bugs_path, None) + new_bug.uuid = old_bug.uuid + new_bug.summary = old_bug.summary + new_bug.creator = old_bug.creator + new_bug.target = old_bug.target + new_bug.status = old_bug.status + new_bug.severity = old_bug.severity + + new_bug.save() + for uuid in root.list_uuids(): + old_bug = OldBug(root.bugs_path, uuid) + old_bug.delete() + + bugdir.set_version(root.dir) + +def file_property(name, valid=None): + def getter(self): + value = self._get_value(name) + if valid is not None: + if value not in valid: + raise InvalidValue(name, value) + return value + def setter(self, value): + if valid is not None: + if value not in valid and value is not None: + raise InvalidValue(name, value) + return self._set_value(name, value) + return property(getter, setter) + + +class OldBug(object): + def __init__(self, path, uuid): + self.path = os.path.join(path, uuid) + self.uuid = uuid + + def get_path(self, file): + return os.path.join(self.path, file) + + summary = file_property("summary") + creator = file_property("creator") + target = file_property("target") + status = file_property("status", valid=("open", "closed")) + severity = file_property("severity", valid=("wishlist", "minor", "serious", + "critical", "fatal")) + def delete(self): + self.summary = None + self.creator = None + self.target = None + self.status = None + self.severity = None + self._set_value("name", None) + + def _get_active(self): + return self.status == "open" + + active = property(_get_active) + + def _get_value(self, name): + try: + return file(self.get_path(name), "rb").read().rstrip("\n") + except IOError, e: + if e.errno == errno.EEXIST: + return None + + def _set_value(self, name, value): + if value is None: + try: + rcs.unlink(self.get_path(name)) + except OSError, e: + if e.errno != 2: + raise + else: + rcs.set_file_contents(self.get_path(name), "%s\n" % value) + + + diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 9851e9d..58fa877 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -13,27 +13,40 @@ class NoBugDir(Exception): self.path = path -def tree_root(dir): +def tree_root(dir, old_version=False): rootdir = os.path.realpath(dir) while (True): versionfile=os.path.join(rootdir, ".be/version") if os.path.exists(versionfile): - test_version(versionfile) + if not old_version: + test_version(versionfile) break; elif rootdir == "/": raise NoBugDir(dir) rootdir=os.path.dirname(rootdir) return BugDir(os.path.join(rootdir, ".be")) +class BadTreeVersion(Exception): + def __init__(self, version): + Exception.__init__(self, "Unsupported tree version: %s" % version) + self.version = version + def test_version(path): - assert (file(path, "rb").read() == "Bugs Everywhere Tree 0 0\n") + tree_version = file(path, "rb").read() + if tree_version != TREE_VERSION_STRING: + raise BadTreeVersion(tree_version) + +def set_version(path): + rcs.set_file_contents(os.path.join(path, "version"), TREE_VERSION_STRING) + + +TREE_VERSION_STRING = "Bugs Everywhere Tree 1 0\n" def create_bug_dir(path): root = os.path.join(path, ".be") rcs.mkdir(root) rcs.mkdir(os.path.join(root, "bugs")) - rcs.set_file_contents(os.path.join(root, "version"), - "Bugs Everywhere Tree 0 0\n") + set_version(root) return BugDir(path) @@ -42,18 +55,24 @@ class BugDir: self.dir = dir self.bugs_path = os.path.join(self.dir, "bugs") - def list(self): + for uuid in self.list_uuids(): + yield Bug(self.bugs_path, uuid) + + def list_uuids(self): for uuid in os.listdir(self.bugs_path): if (uuid.startswith('.')): continue - yield Bug(self.bugs_path, uuid) + yield uuid def new_bug(self): uuid = names.uuid() path = os.path.join(self.bugs_path, uuid) rcs.mkdir(path) - return Bug(self.bugs_path, uuid) + bug = Bug(self.bugs_path, None) + bug.uuid = uuid + return bug + class InvalidValue(Exception): def __init__(self, name, value): msg = "Cannot assign value %s to %s" % (value, name) @@ -61,52 +80,48 @@ class InvalidValue(Exception): self.name = name self.value = value -def file_property(name, valid=None): + +def checked_property(name, valid): def getter(self): - value = self._get_value(name) - if valid is not None: - if value not in valid: - raise InvalidValue(name, value) + value = self.__getattribute__("_"+name) + if value not in valid: + raise InvalidValue(name, value) return value + def setter(self, value): - if valid is not None: - if value not in valid: - raise InvalidValue(name, value) - return self._set_value(name, value) + if value not in valid: + raise InvalidValue(name, value) + return self.__setattr__("_"+name, value) return property(getter, setter) + class Bug(object): + status = checked_property("status", (None, "open", "closed")) + severity = checked_property("severity", (None, "wishlist", "minor", + "serious", "critical", "fatal")) + def __init__(self, path, uuid): - self.path = os.path.join(path, uuid) + self.path = path self.uuid = uuid + if uuid is not None: + dict = mapfile.parse(file(self.get_path("values"))) + else: + dict = {} - def get_path(self, file): - return os.path.join(self.path, file) + self.summary = dict.get("summary") + self.creator = dict.get("creator") + self.target = dict.get("target") + self.status = dict.get("status") + self.severity = dict.get("severity") - summary = file_property("summary") - creator = file_property("creator") - target = file_property("target") - status = file_property("status", valid=("open", "closed")) - severity = file_property("severity", valid=("wishlist", "minor", "serious", - "critical", "fatal")) + def get_path(self, file): + return os.path.join(self.path, self.uuid, file) def _get_active(self): return self.status == "open" active = property(_get_active) - def _get_value(self, name): - try: - return file(self.get_path(name), "rb").read().rstrip("\n") - except IOError, e: - if e.errno == errno.EEXIST: - return None - - def _set_value(self, name, value): - if value is None: - rcs.unlink(self.get_path(name)) - rcs.set_file_contents(self.get_path(name), "%s\n" % value) - def add_attr(self, map, name): value = self.__getattribute__(name) if value is not None: @@ -120,8 +135,7 @@ class Bug(object): self.add_attr(map, "status") self.add_attr(map, "severity") path = self.get_path("values") - output = file(path, "wb") if not os.path.exists(path): rcs.add_id(path) - mapfile.generate2(output, map) - + output = file(path, "wb") + mapfile.generate(output, map) diff --git a/libbe/mapfile.py b/libbe/mapfile.py index 6a8e23e..82eadae 100644 --- a/libbe/mapfile.py +++ b/libbe/mapfile.py @@ -12,92 +12,6 @@ class FileString(object): self.str += line -def parse(f): - """Parses a mapfile, returns a Dictionary - - >>> f = FileString("1:q\\n2:q\\n3:q\\n>p\\n4:q\\n5:q\\n6:q\\n") - >>> parse(f)["q"] - 'p' - >>> parse("1:q\\n2:q\\n3:q\\n>r\\n4:q\\n5:q\\n6:q\\n")["q"] - 'r' - >>> parse("1:q:5\\n>s\\n2:q:5\\n")["q:5"] - 's' - >>> parse("1:q\\n>s\\n2:q\\n1:q\\n>s\\n2:q\\n") - Traceback (most recent call last): - File "", line 1, in ? - File "libbe/mapfile.py", line 41, in parse - assert (lnum == prev_num + 1) - AssertionError - >>> parse("1:q\\n>s\\n2:q\\n1:l\\n>s\\n2:l\\n1:q\\n>s\\n2:q\\n") - Traceback (most recent call last): - AssertionError - >>> parse("1:q\\n>s\\n>s\\n2:q\\n") - Traceback (most recent call last): - AssertionError - """ - if isinstance(f, basestring): - f = FileString(f) - result = {} - name = None - prev_num = None - for line in f: - value = None - # Handle values - if line.startswith(">"): - assert (name is not None) - assert (not result.has_key(name)) - result[name] = line[1:].rstrip("\n") - # Handle names - else: - lname = ":".join(line.split(":")[1:]).rstrip("\n") - lnum = int(line.split(":")[0]) - - #special-case the first execution - if name is None: - name = lname - - #ensure sequential operation - elif lname == name: - assert (lnum == prev_num + 1) - #if name changes, start over at 1 - else: - if lnum != 1: - assert(lname != name) - raise "%i %s %s" % (lnum, lname, name) - assert (lnum == 1) - name = lname - prev_num = lnum - return result - - -def generate(f, map, context=3): - """ - >>> f = FileString() - >>> generate(f, {"q":"p"}) - >>> f.str - '1:q\\n2:q\\n3:q\\n>p\\n4:q\\n5:q\\n6:q\\n' - >>> parse(f)["q"] - 'p' - >>> f = FileString() - >>> generate(f, {"a":"b", "c":"d", "e":"f"}) - >>> dict = parse(f) - >>> dict["a"] - 'b' - >>> dict["c"] - 'd' - >>> dict["e"] - 'f' - """ - assert(context > 0) - keys = map.keys() - keys.sort() - for key in keys: - for i in range(context): - f.write("%i:%s\n" % (i+1, key)) - f.write(">%s\n" % map[key]) - for i in range(context): - f.write("%i:%s\n" % (i+context+1, key)) - class IllegalKey(Exception): def __init__(self, key): Exception.__init__(self, 'Illegal key "%s"' % key) @@ -108,28 +22,28 @@ class IllegalValue(Exception): Exception.__init__(self, 'Illegal value "%s"' % value) self.value = value -def generate2(f, map, context=3): +def generate(f, map, context=3): """Generate a format-2 mapfile. This is a simpler format, but should merge better, because there's no chance of confusion for appends, and lines are unique for both key and value. >>> f = FileString() - >>> generate2(f, {"q":"p"}) + >>> generate(f, {"q":"p"}) >>> f.str '\\n\\n\\nq=p\\n\\n\\n\\n' - >>> generate2(f, {"q=":"p"}) + >>> generate(f, {"q=":"p"}) Traceback (most recent call last): IllegalKey: Illegal key "q=" - >>> generate2(f, {"q\\n":"p"}) + >>> generate(f, {"q\\n":"p"}) Traceback (most recent call last): IllegalKey: Illegal key "q\\n" - >>> generate2(f, {"":"p"}) + >>> generate(f, {"":"p"}) Traceback (most recent call last): IllegalKey: Illegal key "" - >>> generate2(f, {">q":"p"}) + >>> generate(f, {">q":"p"}) Traceback (most recent call last): IllegalKey: Illegal key ">q" - >>> generate2(f, {"q":"p\\n"}) + >>> generate(f, {"q":"p\\n"}) Traceback (most recent call last): IllegalValue: Illegal value "p\\n" """ @@ -160,16 +74,16 @@ def get_file(f): else: return f -def parse2(f): +def parse(f): """ Parse a format-2 mapfile. - >>> parse2('\\n\\n\\nq=p\\n\\n\\n\\n')['q'] + >>> parse('\\n\\n\\nq=p\\n\\n\\n\\n')['q'] 'p' - >>> parse2('\\n\\nq=\\'p\\'\\n\\n\\n\\n')['q'] + >>> parse('\\n\\nq=\\'p\\'\\n\\n\\n\\n')['q'] "\'p\'" >>> f = FileString() - >>> generate2(f, {"a":"b", "c":"d", "e":"f"}) - >>> dict = parse2(f) + >>> generate(f, {"a":"b", "c":"d", "e":"f"}) + >>> dict = parse(f) >>> dict["a"] 'b' >>> dict["c"] diff --git a/libbe/rcs.py b/libbe/rcs.py index 0da1513..dd0c008 100644 --- a/libbe/rcs.py +++ b/libbe/rcs.py @@ -10,5 +10,9 @@ def set_file_contents(path, contents): add_id(path) def unlink(path): - os.unlink(path) - delete_id(filename) + try: + os.unlink(path) + delete_id(path) + except OSError, e: + if e.errno != 2: + raise -- 2.26.2