added bugs, Switched to using uuid prefixes to ensure uniqueness
authorAaron Bentley <abentley@panoramicfeedback.com>
Wed, 9 Mar 2005 20:03:07 +0000 (20:03 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Wed, 9 Mar 2005 20:03:07 +0000 (20:03 +0000)
26 files changed:
.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator [new file with mode: 0644]
.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/name [new file with mode: 0644]
.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/severity [new file with mode: 0644]
.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/status [new file with mode: 0644]
.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/summary [new file with mode: 0644]
.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/creator [new file with mode: 0644]
.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/name [new file with mode: 0644]
.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/severity [new file with mode: 0644]
.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/status [new file with mode: 0644]
.be/bugs/3613e6e9-db9e-4775-8914-f31f0b4b81ac/summary [new file with mode: 0644]
.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/creator [new file with mode: 0644]
.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/name [new file with mode: 0644]
.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/severity [new file with mode: 0644]
.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/status [new file with mode: 0644]
.be/bugs/372f8a5c-a1ce-4b07-a7b1-f409033a7eec/summary [new file with mode: 0644]
.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/creator [new file with mode: 0644]
.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/name [new file with mode: 0644]
.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/severity [new file with mode: 0644]
.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/status [new file with mode: 0644]
.be/bugs/73a767f4-75e7-4cde-9e24-91bff99ab428/summary [new file with mode: 0644]
.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/creator [new file with mode: 0644]
.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/name [new file with mode: 0644]
.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/severity [new file with mode: 0644]
.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/status [new file with mode: 0644]
.be/bugs/9f910ee0-ff0f-4fa3-b1e3-79a4118e48e9/summary [new file with mode: 0644]
libbe/cmdutil.py

diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/creator
new file mode 100644 (file)
index 0000000..ce73549
--- /dev/null
@@ -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 (file)
index 0000000..d213809
--- /dev/null
@@ -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 (file)
index 0000000..acb503f
--- /dev/null
@@ -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 (file)
index 0000000..f510327
--- /dev/null
@@ -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 (file)
index 0000000..1cf46cb
--- /dev/null
@@ -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 (file)
index 0000000..ce73549
--- /dev/null
@@ -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 (file)
index 0000000..a39c86e
--- /dev/null
@@ -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 (file)
index 0000000..acb503f
--- /dev/null
@@ -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 (file)
index 0000000..f510327
--- /dev/null
@@ -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 (file)
index 0000000..4c17f24
--- /dev/null
@@ -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 (file)
index 0000000..ce73549
--- /dev/null
@@ -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 (file)
index 0000000..d213809
--- /dev/null
@@ -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 (file)
index 0000000..acb503f
--- /dev/null
@@ -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 (file)
index 0000000..f510327
--- /dev/null
@@ -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 (file)
index 0000000..2cb4148
--- /dev/null
@@ -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 (file)
index 0000000..ce73549
--- /dev/null
@@ -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 (file)
index 0000000..d213809
--- /dev/null
@@ -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 (file)
index 0000000..acb503f
--- /dev/null
@@ -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 (file)
index 0000000..f510327
--- /dev/null
@@ -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 (file)
index 0000000..682e915
--- /dev/null
@@ -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 (file)
index 0000000..ce73549
--- /dev/null
@@ -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 (file)
index 0000000..d213809
--- /dev/null
@@ -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 (file)
index 0000000..acb503f
--- /dev/null
@@ -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 (file)
index 0000000..1ac2082
--- /dev/null
@@ -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 (file)
index 0000000..b3ce992
--- /dev/null
@@ -0,0 +1 @@
+prevent collisions in different branches
index 560c78d2128513cd805ca2f3f66653c51180edd0..22142602e38ade968e402be6cedada18265d221b 100644 (file)
@@ -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: