changeset 725:c6b912f8b5b2

Merge with Matt's tip.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 19 Jul 2005 07:00:03 -0800
parents 1c0c413cccdd (current diff) 7dae73778114 (diff)
children 809a870a0e73
files .hgignore doc/FAQ.txt doc/hg.1.txt mercurial/commands.py mercurial/hg.py mercurial/util.py templates/map tests/test-help.out
diffstat 7 files changed, 68 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore	Mon Jul 18 06:54:21 2005 -0800
+++ b/.hgignore	Tue Jul 19 07:00:03 2005 -0800
@@ -1,12 +1,13 @@
-.*\.orig
-.*\.rej
-.*~
-.*\.so
-.*pyc
-build/.*
-dist/
-doc/.*\.[0-9]
-MANIFEST$
-.pc/
-patches/
-mercurial/__version__.py$
+\.orig$
+\.rej$
+~$
+\.so$
+\.pyc$
+\.swp$
+^build/
+^dist/
+^doc/.*\.[0-9]$
+^MANIFEST$
+^.pc/
+^patches/
+^mercurial/__version__.py$
--- a/doc/FAQ.txt	Mon Jul 18 06:54:21 2005 -0800
+++ b/doc/FAQ.txt	Tue Jul 19 07:00:03 2005 -0800
@@ -65,7 +65,7 @@
 
 The 'tip' is the most recently changed head, and also the highest
 numbered revision. If you have just made a commit, that commit will be
-the head. Alternately, if you have just pulled from another
+the tip. Alternately, if you have just pulled from another
 repository, the tip of that repository becomes the current tip.
 
 The 'tip' is the default revision for many commands such as update,
@@ -152,7 +152,7 @@
 pull multiple copies over the network. No need to check files out here
 as you won't be changing them.
 
-The outgoing tree contains all the changes you intend for merger into
+The outgoing tree contains all the changes you intend for merge into
 upsteam. Publish this tree with 'hg serve" or hgweb.cgi or use 'hg
 push" to push it to another publicly availabe repository.
 
@@ -196,7 +196,7 @@
 
 If you'd like to request a feature, send your request to
 mercurial@selenic.com. As Mercurial is still very new, there are
-certainly features it is missing and you can give up feedback on how
+certainly features it is missing and you can give us feedback on how
 best to implement them.
 
 
@@ -256,7 +256,7 @@
 A manifest is simply a list of all files in a given revision of a
 project along with the nodeids of the corresponding file revisions. So
 grabbing a given version of the project means simply looking up its
-manifest and reconstruction all the file revisions pointed to by it.
+manifest and reconstructing all the file revisions pointed to by it.
 
 A changeset is a list of all files changed in a check-in along with a
 change description and some metadata like user and date. It also
--- a/mercurial/commands.py	Mon Jul 18 06:54:21 2005 -0800
+++ b/mercurial/commands.py	Tue Jul 19 07:00:03 2005 -0800
@@ -352,7 +352,7 @@
     repo.add(u)
     repo.remove(d)
 
-def annotate(u, repo, file1, *files, **ops):
+def annotate(ui, repo, file1, *files, **opts):
     """show changeset information per file line"""
     def getnode(rev):
         return hg.short(repo.changelog.node(rev))
@@ -374,12 +374,13 @@
 
     bcache = {}
     opmap = [['user', getname], ['number', str], ['changeset', getnode]]
-    if not ops['user'] and not ops['changeset']:
-        ops['number'] = 1
+    if not opts['user'] and not opts['changeset']:
+        opts['number'] = 1
 
-    node = repo.dirstate.parents()[0]
-    if ops['revision']:
-        node = repo.changelog.lookup(ops['revision'])
+    if opts['rev']:
+        node = repo.changelog.lookup(opts['rev'])
+    else:
+        node = repo.dirstate.parents()[0]
     change = repo.changelog.read(node)
     mmap = repo.manifest.read(change[0])
     for f in relpath(repo, (file1,) + files):
@@ -387,13 +388,13 @@
         pieces = []
 
         for o, f in opmap:
-            if ops[o]:
+            if opts[o]:
                 l = [f(n) for n, dummy in lines]
                 m = max(map(len, l))
                 pieces.append(["%*s" % (m, x) for x in l])
 
         for p, l in zip(zip(*pieces), lines):
-            u.write(" ".join(p) + ": " + l[1])
+            ui.write("%s: %s" % (" ".join(p), l[1]))
 
 def cat(ui, repo, file1, rev=None, **opts):
     """output the latest or given revision of a file"""
@@ -576,6 +577,7 @@
             outname = make_filename(repo, repo.changelog, opts['output'],
                                     node=node, total=total, seqno=seqno,
                                     revwidth=revwidth)
+            ui.note("Exporting patch to '%s'.\n" % outname)
             fp = open(outname, 'wb')
         except KeyError, inst:
             ui.warn("error: invalid format spec '%%%s' in output file name\n" %
@@ -774,10 +776,10 @@
     for f in files:
         ui.write("%40s %3s %s\n" % (hg.hex(m[f]), mf[f] and "755" or "644", f))
 
-def parents(ui, repo, node=None):
-    '''show the parents of the current working dir'''
-    if node:
-        p = repo.changelog.parents(repo.lookup(hg.bin(node)))
+def parents(ui, repo, rev=None):
+    """show the parents of the working dir or revision"""
+    if rev:
+        p = repo.changelog.parents(repo.lookup(rev))
     else:
         p = repo.dirstate.parents()
 
@@ -1032,9 +1034,8 @@
             ui.status("(please commit .hgtags manually)\n")
             return -1
 
-    add = not os.path.exists(repo.wjoin(".hgtags"))
     repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name))
-    if add:
+    if repo.dirstate.state(".hgtags") == '?':
         repo.add([".hgtags"])
 
     if not opts['text']:
@@ -1100,53 +1101,53 @@
     "^add": (add,
              [('I', 'include', [], 'include path in search'),
               ('X', 'exclude', [], 'exclude path from search')],
-             "hg add [options] [files]"),
-    "addremove": (addremove, [], "hg addremove [files]"),
+             "hg add [OPTIONS] [FILES]"),
+    "addremove": (addremove, [], "hg addremove [FILES]"),
     "^annotate":
         (annotate,
-         [('r', 'revision', '', 'revision'),
+         [('r', 'rev', '', 'revision'),
           ('u', 'user', None, 'show user'),
           ('n', 'number', None, 'show revision number'),
           ('c', 'changeset', None, 'show changeset')],
-         'hg annotate [-u] [-c] [-n] [-r id] [files]'),
+         'hg annotate [-r REV] [-u] [-n] [-c] FILE...'),
     "cat":
         (cat,
          [('o', 'output', "", 'output to file')],
-         'hg cat [-o outfile] <file> [rev]'),
+         'hg cat [-o OUTFILE] FILE [REV]'),
     "^clone":
         (clone,
          [('U', 'noupdate', None, 'skip update after cloning')],
-         'hg clone [options] <source> [dest]'),
+         'hg clone [-U] SOURCE [DEST]'),
     "^commit|ci":
         (commit,
-         [('t', 'text', "", 'commit text'),
-          ('A', 'addremove', None, 'run add/remove during commit'),
+         [('A', 'addremove', None, 'run add/remove during commit'),
+          ('t', 'text', "", 'commit text'),
           ('l', 'logfile', "", 'commit text file'),
           ('d', 'date', "", 'date code'),
           ('u', 'user', "", 'user')],
-         'hg commit [files]'),
-    "copy": (copy, [], 'hg copy <source> <dest>'),
+         'hg commit [OPTION]... [FILE]...'),
+    "copy": (copy, [], 'hg copy SOURCE DEST'),
     "debugcheckstate": (debugcheckstate, [], 'debugcheckstate'),
     "debugstate": (debugstate, [], 'debugstate'),
-    "debugindex": (debugindex, [], 'debugindex <file>'),
-    "debugindexdot": (debugindexdot, [], 'debugindexdot <file>'),
+    "debugindex": (debugindex, [], 'debugindex FILE'),
+    "debugindexdot": (debugindexdot, [], 'debugindexdot FILE'),
     "^diff":
         (diff,
          [('r', 'rev', [], 'revision')],
-         'hg diff [-r A] [-r B] [files]'),
+         'hg diff [-r REV1 [-r REV2]] [FILE]...'),
     "^export":
         (export,
          [('o', 'output', "", 'output to file')],
-         "hg export [-o file] <changeset> ..."),
-    "forget": (forget, [], "hg forget [files]"),
+         "hg export [-o OUTFILE] REV..."),
+    "forget": (forget, [], "hg forget FILE..."),
     "heads": (heads, [], 'hg heads'),
-    "help": (help_, [], 'hg help [command]'),
+    "help": (help_, [], 'hg help [COMMAND]'),
     "identify|id": (identify, [], 'hg identify'),
     "import|patch":
         (import_,
          [('p', 'strip', 1, 'path strip'),
           ('b', 'base', "", 'base path')],
-         "hg import [options] <patches>"),
+         "hg import [-p NUM] [-b BASE] PATCH..."),
     "^init": (init, [], 'hg init'),
     "locate":
         (locate,
@@ -1155,19 +1156,19 @@
           ('I', 'include', [], 'include path in search'),
           ('r', 'rev', '', 'revision'),
           ('X', 'exclude', [], 'exclude path from search')],
-         'hg locate [options] [files]'),
+         'hg locate [OPTION]... [PATTERN]...'),
     "^log|history":
         (log,
          [('r', 'rev', [], 'revision'),
           ('p', 'patch', None, 'show patch')],
-         'hg log [-r A] [-r B] [-p] [file]'),
-    "manifest": (manifest, [], 'hg manifest [rev]'),
-    "parents": (parents, [], 'hg parents [node]'),
+         'hg log [-r REV1 [-r REV2]] [-p] [FILE]'),
+    "manifest": (manifest, [], 'hg manifest [REV]'),
+    "parents": (parents, [], 'hg parents [REV]'),
     "^pull":
         (pull,
          [('u', 'update', None, 'update working directory')],
-         'hg pull [options] [source]'),
-    "^push": (push, [], 'hg push <destination>'),
+         'hg pull [-u] [SOURCE]'),
+    "^push": (push, [], 'hg push [DEST]'),
     "rawcommit":
         (rawcommit,
          [('p', 'parent', [], 'parent'),
@@ -1176,14 +1177,14 @@
           ('F', 'files', "", 'file list'),
           ('t', 'text', "", 'commit text'),
           ('l', 'logfile', "", 'commit text file')],
-         'hg rawcommit [options] [files]'),
+         'hg rawcommit [OPTION]... [FILE]...'),
     "recover": (recover, [], "hg recover"),
-    "^remove|rm": (remove, [], "hg remove [files]"),
+    "^remove|rm": (remove, [], "hg remove FILE..."),
     "^revert":
         (revert,
          [("n", "nonrecursive", None, "don't recurse into subdirs"),
           ("r", "rev", "", "revision")],
-         "hg revert [files|dirs]"),
+         "hg revert [-n] [-r REV] NAME..."),
     "root": (root, [], "hg root"),
     "^serve":
         (serve,
@@ -1194,7 +1195,7 @@
           ('n', 'name', os.getcwd(), 'repository name'),
           ('', 'stdio', None, 'for remote clients'),
           ('t', 'templates', "", 'template map')],
-         "hg serve [options]"),
+         "hg serve [OPTION]..."),
     "^status": (status, [], 'hg status'),
     "tag":
         (tag,
@@ -1202,7 +1203,7 @@
           ('t', 'text', "", 'commit text'),
           ('d', 'date', "", 'date code'),
           ('u', 'user', "", 'user')],
-         'hg tag [options] <name> [rev]'),
+         'hg tag [OPTION]... NAME [REV]'),
     "tags": (tags, [], 'hg tags'),
     "tip": (tip, [], 'hg tip'),
     "undo": (undo, [], 'hg undo'),
@@ -1210,7 +1211,7 @@
         (update,
          [('m', 'merge', None, 'allow merging of conflicts'),
           ('C', 'clean', None, 'overwrite locally modified files')],
-         'hg update [options] [node]'),
+         'hg update [-m] [-C] [REV]'),
     "verify": (verify, [], 'hg verify'),
     "version": (show_version, [], 'hg version'),
     }
--- a/mercurial/hg.py	Mon Jul 18 06:54:21 2005 -0800
+++ b/mercurial/hg.py	Tue Jul 19 07:00:03 2005 -0800
@@ -216,7 +216,8 @@
                     # item not found, insert a new one
                     end = bs
                     if w[1] == 1:
-                        sys.stderr.write("failed to remove %s from manifest" % f)
+                        sys.stderr.write("failed to remove %s from manifest\n"
+                                         % f)
                         sys.exit(1)
                 else:
                     # item is found, replace/delete the existing line
@@ -231,7 +232,7 @@
 
         text = "".join(self.addlist)
         if cachedelta and mdiff.patch(self.listcache[0], cachedelta) != text:
-            sys.stderr.write("manifest delta failure")
+            sys.stderr.write("manifest delta failure\n")
             sys.exit(1)
         n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
         self.mapcache = (n, map, flags)
--- a/templates/map	Mon Jul 18 06:54:21 2005 -0800
+++ b/templates/map	Tue Jul 19 07:00:03 2005 -0800
@@ -7,7 +7,7 @@
 filenodelink = "<a href="?cmd=file;filenode=#filenode#;file=#file#">#file#</a> "
 fileellipses = "..."
 changelogentry = changelogentry.tmpl
-searchentry = searchentry.tmpl
+searchentry = changelogentry.tmpl
 changeset = changeset.tmpl
 manifest = manifest.tmpl
 manifestdirentry = "<tr class="parity#parity#"><td><tt>drwxr-xr-x</tt>&nbsp;<td><a href="?cmd=manifest;manifest=#manifest#;path=#path#">#basename#/</a>"
--- a/templates/searchentry.tmpl	Mon Jul 18 06:54:21 2005 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-<div class="parity#parity#">
-<table width="100%" cellpadding="0" cellspacing="0">
-<tr>
- <td align="right" width="15%"><b>#date|age# ago:&nbsp;</b></td>
- <td><b>#desc|firstline|escape#</b></td></tr>
-<tr>
- <td align="right">changeset #rev#:&nbsp;</td>
- <td><a href="?cmd=changeset;node=#node#">#node|short#</a></td></tr>
-#parent#
-#changelogtag#
-<tr>
- <td align="right">author:&nbsp;</td>
- <td>#author|obfuscate#</td></tr>
-<tr>
- <td align="right">date:&nbsp;</td>
- <td>#date|date#</td></tr>
-<tr>
- <td align="right" valign="top"><a href="?cmd=manifest;manifest=#manifest#;path=/">files</a>:&nbsp;</td>
- <td>#files#</td></tr>
-</table>
-</div>
-
--- a/tests/test-help.out	Mon Jul 18 06:54:21 2005 -0800
+++ b/tests/test-help.out	Tue Jul 19 07:00:03 2005 -0800
@@ -33,14 +33,14 @@
  status     show changed files in the working directory
  update     update or merge working directory
 hg add: option -h not recognized
-hg add [files]
+hg add FILE...
 
 add the specified files on the next commit
 hg add: option --skjdfks not recognized
-hg add [files]
+hg add FILE...
 
 add the specified files on the next commit
-hg diff [-r A] [-r B] [files]
+hg diff [-r REV1 [-r REV2]] [FILE]...
 
  -r --rev 
    revision