self.parent = None
self.child = None
self.branches = set([])
+ self.branch = None
def selected(self):
return self == self.history.current()
def unixtime(self):
item.child = self.by_native_d.get(backend.succ(item.native))
if item.parent and item.parent.child != item:
item.parent.branches.add(item)
+ for (name, rev) in self.symbols.items():
+ if backend.isbranch(rev):
+ base = backend.branch_to_base(rev, self)
+ tip = backend.branch_to_tip(rev, self)
+ while True:
+ self.by_native_d[base].branch = name
+ if base == tip:
+ break
+ base = backend.succ(base)
#for item in self.revlist:
# print item
#print self.by_revno_d.keys()
continue
sys.stdout.write("= %s %s\n" % (arg, ((WIDTH - len(arg) - 3) * "=")))
for item in ctx.resolve(History(arg), backwards=True):
- sys.stdout.write("%-4d | %s\n%s" % (item.revno,item.date,item.log))
+ sys.stdout.write("%-4d | %s | %s\n%s" \
+ % (item.revno, item.date, item.branch, item.log))
sys.stdout.write(("-" * WIDTH) + "\n")
if limit is not None:
limit -= 1
for key in keys:
value = metadata.symbols[key]
if legend == "branch":
- # Note! This code relies on backend.branch_to_base()
+ # Note! This code relies on backend.branch_to_parent()
# returning an empty string when called on a trunk
# revision.
- display = backend.branch_to_base(value)
+ display = backend.branch_to_parent(value)
if not display:
display = 0
else:
def isbranch(self, symbol):
"Is this a branch symbol?"
return "0." in symbol
- def branch_to_base(self, revid):
+ def branch_to_parent(self, revid):
"Go from a branch ID sticky tag to the revision it was based on."
# Must return an empty string for the fake root sticky tag.
return self.joinrev(self.splitrev(revid)[:-2])
- def branch_to_tip(self, revid, metadata):
- "Go from a branch ID sticky tag to the tip revision of its base."
- rev = self.branch_to_base(revid)
+ def branch_to_base(self, revid, metadata):
+ "Go from a branch ID sticky tag to the first revision of its branch."
+ rev = self.branch_to_parent(revid)
if rev:
rev += ".1.1"
else:
rev = "1.1"
+ return rev
+ def branch_to_tip(self, revid, metadata):
+ "Go from a branch ID sticky tag to the tip revision of its branch."
+ rev = self.branch_to_base(revid, metadata)
while True:
nxt = self.succ(rev)
if metadata.native_to_revno(nxt) is None:
cat >testfile2 <<EOF
= testfile1 ============================================================
-2 | 1970-01-02T00:01:00Z
+2 | 1970-01-02T00:01:00Z | trunk
Second comment
------------------------------------------------------------------------
-1 | 1970-01-02T00:00:00Z
+1 | 1970-01-02T00:00:00Z | trunk
First comment
------------------------------------------------------------------------
EOF
cat >testfile4 <<EOF
= testfile1 ============================================================
-3 | 1970-01-02T00:02:00Z
+3 | 1970-01-02T00:02:00Z | trunk
'Third' comment
------------------------------------------------------------------------
-2 | 1970-01-02T00:01:00Z
+2 | 1970-01-02T00:01:00Z | trunk
Second comment
------------------------------------------------------------------------
-1 | 1970-01-02T00:00:00Z
+1 | 1970-01-02T00:00:00Z | trunk
First comment
------------------------------------------------------------------------
EOF
cat >sample.seqlog <<EOF
= sample ===============================================================
-6 | 1970-01-02T00:05:00Z
+6 | 1970-01-02T00:05:00Z | muggle
Still utterly fubar
------------------------------------------------------------------------
-5 | 1970-01-02T00:04:00Z
+5 | 1970-01-02T00:04:00Z | muggle
Totally unfubared.
------------------------------------------------------------------------
-4 | 1970-01-02T00:03:00Z
+4 | 1970-01-02T00:03:00Z | trunk
On a branch?
------------------------------------------------------------------------
-3 | 1970-01-02T00:02:00Z
+3 | 1970-01-02T00:02:00Z | trunk
Third comment.
------------------------------------------------------------------------
-2 | 1970-01-02T00:01:00Z
+2 | 1970-01-02T00:01:00Z | trunk
Second comment.
------------------------------------------------------------------------
EOF
cat >sample.branchlog <<EOF
= sample ===============================================================
-6 | 1970-01-02T00:05:00Z
+6 | 1970-01-02T00:05:00Z | muggle
Still utterly fubar
------------------------------------------------------------------------
-5 | 1970-01-02T00:04:00Z
+5 | 1970-01-02T00:04:00Z | muggle
Totally unfubared.
------------------------------------------------------------------------
-3 | 1970-01-02T00:02:00Z
+3 | 1970-01-02T00:02:00Z | trunk
Third comment.
------------------------------------------------------------------------
-2 | 1970-01-02T00:01:00Z
+2 | 1970-01-02T00:01:00Z | trunk
Second comment.
------------------------------------------------------------------------
EOF
cat >newlog <<EOF
= sample ===============================================================
-12 | 1970-01-02T00:11:00Z
+12 | 1970-01-02T00:11:00Z | sample
I see you
------------------------------------------------------------------------
-11 | 1970-01-02T00:10:00Z
+11 | 1970-01-02T00:10:00Z | sample
That's good.
------------------------------------------------------------------------
-10 | 1970-01-02T00:09:00Z
+10 | 1970-01-02T00:09:00Z | sample
No good.
------------------------------------------------------------------------
-9 | 1970-01-02T00:08:00Z
+9 | 1970-01-02T00:08:00Z | sample
It' all good.
------------------------------------------------------------------------
-8 | 1970-01-02T00:07:00Z
+8 | 1970-01-02T00:07:00Z | sample
All fixed up.
------------------------------------------------------------------------
-7 | 1970-01-02T00:06:00Z
+7 | 1970-01-02T00:06:00Z | muggle
Utterly fubar
------------------------------------------------------------------------
-6 | 1970-01-02T00:05:00Z
+6 | 1970-01-02T00:05:00Z | muggle
Totally chenille.
------------------------------------------------------------------------
-5 | 1970-01-02T00:04:00Z
+5 | 1970-01-02T00:04:00Z | muggle
Still utterly fubar
------------------------------------------------------------------------
-4 | 1970-01-02T00:03:00Z
+4 | 1970-01-02T00:03:00Z | muggle
Totally unfubared.
------------------------------------------------------------------------
-3 | 1970-01-02T00:02:00Z
+3 | 1970-01-02T00:02:00Z | trunk
Third comment.
------------------------------------------------------------------------
-2 | 1970-01-02T00:01:00Z
+2 | 1970-01-02T00:01:00Z | trunk
Second comment.
------------------------------------------------------------------------
-1 | 1970-01-02T00:00:00Z
+1 | 1970-01-02T00:00:00Z | trunk
First comment.
------------------------------------------------------------------------
EOF