changeset 737:8db4d406b3d3

Merge with Matt's tip.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed, 20 Jul 2005 03:52:06 -0800
parents 1e84f1014f33 (current diff) fed842bb84b2 (diff)
children 32a97c9d8e98
files .hgignore contrib/hgit doc/FAQ.txt doc/hg.1.txt mercurial/commands.py mercurial/hg.py mercurial/util.py templates/map tests/test-help.out
diffstat 2 files changed, 13 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgit	Wed Jul 20 03:43:05 2005 -0800
+++ b/contrib/hgit	Wed Jul 20 03:52:06 2005 -0800
@@ -18,7 +18,7 @@
         if node2:
             change = repo.changelog.read(node2)
             mmap2 = repo.manifest.read(change[0])
-            (c, a, d) = repo.diffrevs(node1, node2)
+            (c, a, d, u) = repo.changes(node1, node2)
             def read(f): return repo.file(f).read(mmap2[f])
             date2 = date(change)
         else:
@@ -51,8 +51,7 @@
         doptions = {}
         opts = [('p', 'patch', None, 'patch'),
                 ('r', 'recursive', None, 'recursive')]
-        args = fancyopts.fancyopts(args, opts, doptions,
-                                   'hg diff-tree [options] sha1 sha1')
+        args = fancyopts.fancyopts(args, opts, doptions)
 
     if len(args) < 2:
         help()
@@ -61,7 +60,7 @@
     revs.append(repo.lookup(args[1]))
     args = args[2:]
     if doptions['patch']:
-        commands.dodiff(ui, repo, "", args, *revs)
+        commands.dodiff(sys.stdout, ui, repo, args, *revs)
     else:
         __difftree(repo, args, *revs)
 
@@ -87,8 +86,7 @@
 def catfile(args, ui, repo):
     doptions = {}
     opts = [('s', 'stdin', None, 'stdin')]
-    args = fancyopts.fancyopts(args, opts, doptions,
-                               'hg cat-file type sha1')
+    args = fancyopts.fancyopts(args, opts, doptions)
 
     # in stdin mode, every line except the commit is prefixed with two
     # spaces.  This way the our caller can find the commit without magic
@@ -113,7 +111,7 @@
         if type != "commit":
             sys.stderr.write("aborting hg cat-file only understands commits\n")
             sys.exit(1);
-        n = repo.changelog.lookup(r)
+        n = repo.lookup(r)
         catcommit(repo, n, prefix)
         if doptions['stdin']:
             try:
@@ -148,17 +146,17 @@
     # figure out which commits they are asking for and which ones they
     # want us to stop on
     for i in range(len(args)):
-        if args[i].count('^'):
-            s = args[i].split('^')[1]
-            stop_sha1.append(repo.changelog.lookup(s))
+        if args[i].startswith('^'):
+            s = repo.lookup(args[i][1:])
+            stop_sha1.append(s)
             want_sha1.append(s)
         elif args[i] != 'HEAD':
-            want_sha1.append(args[i])
+            want_sha1.append(repo.lookup(args[i]))
 
     # calculate the graph for the supplied commits
     for i in range(len(want_sha1)):
         reachable.append({});
-        n = repo.changelog.lookup(want_sha1[i]);
+        n = want_sha1[i];
         visit = [n];
         reachable[i][n] = 1
         while visit:
@@ -209,8 +207,7 @@
     doptions = {}
     opts = [('c', 'commit', None, 'commit'),
             ('n', 'max-nr', 0, 'max-nr')]
-    args = fancyopts.fancyopts(args, opts, doptions,
-                               'hg rev-list')
+    args = fancyopts.fancyopts(args, opts, doptions)
     if doptions['commit']:
         full = "commit"
     else:
@@ -227,7 +224,7 @@
     sys.stderr.write("  hgit cat-file [type] sha1\n")
     sys.stderr.write("  hgit diff-tree [-p] [-r] sha1 sha1\n")
     sys.stderr.write("  hgit rev-tree [sha1 ... [^stop sha1]]\n")
-    sys.stderr.write("  hgit rev-list [-c]\n")
+    sys.stderr.write("  hgit rev-list [-c] [sha1 [stop sha1]\n")
 
 cmd = sys.argv[1]
 args = sys.argv[2:]
--- a/mercurial/hg.py	Wed Jul 20 03:43:05 2005 -0800
+++ b/mercurial/hg.py	Wed Jul 20 03:52:06 2005 -0800
@@ -1675,7 +1675,7 @@
             # cross-check
             for node in filenodes[f]:
                 self.ui.warn("node %s in manifests not in %s\n"
-                             % (hex(n), f))
+                             % (hex(node), f))
                 errors += 1
 
         self.ui.status("%d files, %d changesets, %d total revisions\n" %