changeset 1775:0762feff3043

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Tue, 21 Feb 2006 15:48:49 -0600
parents ac7b91bcbd8d (current diff) 982fb022a16a (diff)
children 8a1f2eae2832
files
diffstat 6 files changed, 42 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Tue Feb 21 15:48:22 2006 -0600
+++ b/mercurial/commands.py	Tue Feb 21 15:48:49 2006 -0600
@@ -994,7 +994,7 @@
     change = repo.changelog.read(rev)
     n = change[0]
     files = repo.manifest.readflags(n)
-    wlock = self.repo.wlock()
+    wlock = repo.wlock()
     repo.dirstate.rebuild(rev, files.iteritems())
 
 def debugcheckstate(ui, repo):
@@ -1637,7 +1637,6 @@
             if opts['only_merges'] and len(parents) != 2:
                 continue
 
-            br = None
             if opts['keyword']:
                 changes = getchange(rev)
                 miss = 0
@@ -1650,7 +1649,8 @@
                 if miss:
                     continue
 
-            if opts['branch']:
+            br = None
+            if opts['branches']:
                 br = repo.branchlookup([repo.changelog.node(rev)])
 
             show_changeset(du, repo, rev, brinfo=br)
@@ -1660,9 +1660,10 @@
                 du.write("\n\n")
         elif st == 'iter':
             if count == limit: break
-            count += 1
-            for args in du.hunk[rev]:
-                ui.write(*args)
+            if du.hunk[rev]:
+                count += 1
+                for args in du.hunk[rev]:
+                    ui.write(*args)
 
 def manifest(ui, repo, rev=None):
     """output the latest or given revision of the project manifest
@@ -1713,7 +1714,7 @@
             dodiff(ui, ui, repo, prev, n)
             ui.write("\n")
 
-def parents(ui, repo, rev=None, branch=None):
+def parents(ui, repo, rev=None, branches=None):
     """show the parents of the working dir or revision
 
     Print the working directory's parent revisions.
@@ -1724,7 +1725,7 @@
         p = repo.dirstate.parents()
 
     br = None
-    if branch is not None:
+    if branches is not None:
         br = repo.branchlookup(p)
     for n in p:
         if n != nullid:
@@ -2225,7 +2226,10 @@
     Show the tip revision.
     """
     n = repo.changelog.tip()
-    show_changeset(ui, repo, changenode=n)
+    br = None
+    if opts['branches']:
+        br = repo.branchlookup([n])
+    show_changeset(ui, repo, changenode=n, brinfo=br)
     if opts['patch']:
         dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n)
 
@@ -2440,7 +2444,7 @@
          _('hg grep [OPTION]... PATTERN [FILE]...')),
     "heads":
         (heads,
-         [('b', 'branches', None, _('find branch info')),
+         [('b', 'branches', None, _('show branches')),
           ('r', 'rev', '', _('show only heads which are descendants of rev'))],
          _('hg heads [-b] [-r <rev>]')),
     "help": (help_, [], _('hg help [COMMAND]')),
@@ -2474,7 +2478,7 @@
         (log,
          [('I', 'include', [], _('include names matching the given patterns')),
           ('X', 'exclude', [], _('exclude names matching the given patterns')),
-          ('b', 'branch', None, _('show branches')),
+          ('b', 'branches', None, _('show branches')),
           ('k', 'keyword', [], _('search for a keyword')),
           ('l', 'limit', '', _('limit number of changes displayed')),
           ('r', 'rev', [], _('show the specified revision or range')),
@@ -2490,7 +2494,7 @@
          _('hg outgoing [-p] [-n] [-M] [DEST]')),
     "^parents":
         (parents,
-         [('b', 'branch', None, _('show branches'))],
+         [('b', 'branches', None, _('show branches'))],
          _('hg parents [-b] [REV]')),
     "paths": (paths, [], _('hg paths [NAME]')),
     "^pull":
@@ -2577,7 +2581,11 @@
           ('r', 'rev', '', _('revision to tag'))],
          _('hg tag [-r REV] [OPTION]... NAME')),
     "tags": (tags, [], _('hg tags')),
-    "tip": (tip, [('p', 'patch', None, _('show patch'))], _('hg tip')),
+    "tip":
+        (tip,
+         [('b', 'branches', None, _('show branches')),
+          ('p', 'patch', None, _('show patch'))],
+         _('hg [-b] [-p] tip')),
     "unbundle":
         (unbundle,
          [('u', 'update', None,
--- a/mercurial/hgweb.py	Tue Feb 21 15:48:22 2006 -0600
+++ b/mercurial/hgweb.py	Tue Feb 21 15:48:49 2006 -0600
@@ -660,9 +660,10 @@
         i = self.repo.tagslist()
         i.reverse()
 
-        def entries(**map):
+        def entries(notip=False, **map):
             parity = 0
             for k,n in i:
+                if notip and k == "tip": continue
                 yield {"parity": parity,
                        "tag": k,
                        "tagmanifest": hex(cl.read(n)[0]),
@@ -672,7 +673,8 @@
 
         yield self.t("tags",
                      manifest=hex(mf),
-                     entries=entries)
+                     entries=lambda **x: entries(False, **x),
+                     entriesnotip=lambda **x: entries(True, **x))
 
     def summary(self):
         cl = self.repo.changelog
--- a/templates/map-rss	Tue Feb 21 15:48:22 2006 -0600
+++ b/templates/map-rss	Tue Feb 21 15:48:49 2006 -0600
@@ -4,3 +4,5 @@
 changelogentry = changelogentry-rss.tmpl
 filelog = filelog-rss.tmpl
 filelogentry = filelogentry-rss.tmpl
+tags = tags-rss.tmpl
+tagentry = tagentry-rss.tmpl
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/tagentry-rss.tmpl	Tue Feb 21 15:48:49 2006 -0600
@@ -0,0 +1,6 @@
+<item>
+    <title>#tag|escape#</title>
+    <link>#url#?cs=#node|short#</link>
+    <description><![CDATA[#tag|strip|escape|addbreaks#]]></description>
+    <pubDate>#date|rfc822date#</pubDate>
+</item>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/tags-rss.tmpl	Tue Feb 21 15:48:49 2006 -0600
@@ -0,0 +1,6 @@
+#header#
+    <title>#repo|escape#: tags </title>
+    <description>#repo|escape# tag history</description>
+    #entriesnotip%tagentry#
+  </channel>
+</rss>
--- a/templates/tags.tmpl	Tue Feb 21 15:48:22 2006 -0600
+++ b/templates/tags.tmpl	Tue Feb 21 15:48:49 2006 -0600
@@ -1,11 +1,14 @@
 #header#
 <title>#repo|escape#: tags</title>
+<link rel="alternate" type="application/rss+xml"
+   href="?cmd=tags;style=rss" title="RSS feed for #repo|escape#: tags">
 </head>
 <body>
 
 <div class="buttons">
 <a href="?cl=tip">changelog</a>
 <a href="?mf=#manifest|short#;path=/">manifest</a>
+<a type="application/rss+xml" href="?cmd=tags;style=rss">rss</a>
 </div>
 
 <h2>tags:</h2>