From cddfa700fd6f22bb0ea9f0a4c1f4566b69494748 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Wed, 9 Mar 2005 20:03:07 +0000 Subject: [PATCH] added bugs, Switched to using uuid prefixes to ensure uniqueness --- .../creator | 1 + .../2aa60b34-2c8d-4f41-bb97-a57309523262/name | 1 + .../severity | 1 + .../status | 1 + .../summary | 1 + .../creator | 1 + .../3613e6e9-db9e-4775-8914-f31f0b4b81ac/name | 1 + .../severity | 1 + .../status | 1 + .../summary | 1 + .../creator | 1 + .../372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name | 1 + .../severity | 1 + .../status | 1 + .../summary | 1 + .../creator | 1 + .../73a767f4-75e7-4cde-9e24-91bff99ab428/name | 1 + .../severity | 1 + .../status | 1 + .../summary | 1 + .../creator | 1 + .../9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name | 1 + .../severity | 1 + .../status | 1 + .../summary | 1 + libbe/cmdutil.py | 19 ++++++++++++++++--- 26 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator create mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name create mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity create mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status create mode 100644 .be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary create mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator create mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name create mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity create mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status create mode 100644 .be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary create mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator create mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name create mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity create mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status create mode 100644 .be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary create mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator create mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name create mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity create mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status create mode 100644 .be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary create mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator create mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name create mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity create mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status create mode 100644 .be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator new file mode 100644 index 0000000..ce73549 --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator @@ -0,0 +1 @@ +abentley diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name new file mode 100644 index 0000000..d213809 --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name @@ -0,0 +1 @@ +abentley-4 diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity new file mode 100644 index 0000000..acb503f --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity @@ -0,0 +1 @@ +minor diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status new file mode 100644 index 0000000..f510327 --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status @@ -0,0 +1 @@ +open diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary new file mode 100644 index 0000000..1cf46cb --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary @@ -0,0 +1 @@ +implement message-change log diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator new file mode 100644 index 0000000..ce73549 --- /dev/null +++ b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator @@ -0,0 +1 @@ +abentley diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name new file mode 100644 index 0000000..a39c86e --- /dev/null +++ b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name @@ -0,0 +1 @@ +abentley-3 diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity new file mode 100644 index 0000000..acb503f --- /dev/null +++ b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity @@ -0,0 +1 @@ +minor diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status new file mode 100644 index 0000000..f510327 --- /dev/null +++ b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status @@ -0,0 +1 @@ +open diff --git a/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary new file mode 100644 index 0000000..4c17f24 --- /dev/null +++ b/.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000..ce73549 --- /dev/null +++ b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator @@ -0,0 +1 @@ +abentley diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name new file mode 100644 index 0000000..d213809 --- /dev/null +++ b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name @@ -0,0 +1 @@ +abentley-4 diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity new file mode 100644 index 0000000..acb503f --- /dev/null +++ b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity @@ -0,0 +1 @@ +minor diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status new file mode 100644 index 0000000..f510327 --- /dev/null +++ b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status @@ -0,0 +1 @@ +open diff --git a/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary new file mode 100644 index 0000000..2cb4148 --- /dev/null +++ b/.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary @@ -0,0 +1 @@ +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 new file mode 100644 index 0000000..ce73549 --- /dev/null +++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator @@ -0,0 +1 @@ +abentley diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name new file mode 100644 index 0000000..d213809 --- /dev/null +++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name @@ -0,0 +1 @@ +abentley-4 diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity new file mode 100644 index 0000000..acb503f --- /dev/null +++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity @@ -0,0 +1 @@ +minor diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status new file mode 100644 index 0000000..f510327 --- /dev/null +++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status @@ -0,0 +1 @@ +open diff --git a/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary new file mode 100644 index 0000000..682e915 --- /dev/null +++ b/.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary @@ -0,0 +1 @@ +implement comments diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator new file mode 100644 index 0000000..ce73549 --- /dev/null +++ b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator @@ -0,0 +1 @@ +abentley diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name new file mode 100644 index 0000000..d213809 --- /dev/null +++ b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name @@ -0,0 +1 @@ +abentley-4 diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity new file mode 100644 index 0000000..acb503f --- /dev/null +++ b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity @@ -0,0 +1 @@ +minor diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status new file mode 100644 index 0000000..1ac2082 --- /dev/null +++ b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status @@ -0,0 +1 @@ +closed diff --git a/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary new file mode 100644 index 0000000..b3ce992 --- /dev/null +++ b/.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary @@ -0,0 +1 @@ +prevent collisions in different branches diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py index 560c78d..2214260 100644 --- a/libbe/cmdutil.py +++ b/libbe/cmdutil.py @@ -1,15 +1,28 @@ def unique_name(bug, bugs): - return bug.name + chars = 1 + for some_bug in bugs: + if bug.uuid == some_bug.uuid: + continue + while (bug.uuid[:chars] == some_bug.uuid[:chars]): + chars+=1 + return bug.uuid[:chars] class UserError(Exception): def __init__(self, msg): Exception.__init__(self, msg) def get_bug(spec, bug_dir): + matches = [] bugs = list(bug_dir.list()) for bug in bugs: - if bug.uuid == spec: - return bug + if bug.uuid.startswith(spec): + matches.append(bug) + if len(matches) > 1: + raise UserError("More than one bug matches %s. Please be more" + " specific." % spec) + if len(matches) == 1: + return matches[0] + matches = [] for bug in bugs: if bug.name == spec: -- 2.26.2