changeset 1501:c5c4381d898b

Merge from Hidetaka Iwai
author Matt Mackall <mpm@selenic.com>
date Thu, 03 Nov 2005 14:19:54 -0800
parents 78590fb4a82b (diff) cadde8ebf167 (current diff)
children d176c81481c8
files
diffstat 7 files changed, 77 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Nov 03 11:56:51 2005 +0900
+++ b/mercurial/commands.py	Thu Nov 03 14:19:54 2005 -0800
@@ -1705,10 +1705,7 @@
     This command is not intended to be used by normal users, as it is
     primarily useful for importing from other SCMs.
     """
-    if rc['text']:
-        ui.warn(_("Warning: -t and --text is deprecated,"
-                  " please use -m or --message instead.\n"))
-    message = rc['message'] or rc['text']
+    message = rc['message']
     if not message and rc['logfile']:
         try:
             message = open(rc['logfile']).read()
@@ -1980,9 +1977,6 @@
     similarly to other project files and can be hand-edited if
     necessary.
     """
-    if opts['text']:
-        ui.warn(_("Warning: -t and --text is deprecated,"
-                  " please use -m or --message instead.\n"))
     if name == "tip":
         raise util.Abort(_("the name 'tip' is reserved"))
     if rev:
@@ -2007,7 +2001,7 @@
     if repo.dirstate.state(".hgtags") == '?':
         repo.add([".hgtags"])
 
-    message = (opts['message'] or opts['text'] or
+    message = (opts['message'] or
                _("Added tag %s for changeset %s") % (name, r))
     try:
         repo.commit([".hgtags"], message, opts['user'], opts['date'])
@@ -2291,7 +2285,6 @@
           ('u', 'user', "", _('user')),
           ('F', 'files', "", _('file list')),
           ('m', 'message', "", _('commit message')),
-          ('t', 'text', "", _('commit message (deprecated: use -m)')),
           ('l', 'logfile', "", _('commit message file'))],
          _('hg rawcommit [OPTION]... [FILE]...')),
     "recover": (recover, [], _("hg recover")),
@@ -2339,7 +2332,6 @@
         (tag,
          [('l', 'local', None, _('make the tag local')),
           ('m', 'message', "", _('message for tag commit log entry')),
-          ('t', 'text', "", _('commit message (deprecated: use -m)')),
           ('d', 'date', "", _('record datecode as commit date')),
           ('u', 'user', "", _('record user as commiter'))],
          _('hg tag [OPTION]... NAME [REV]')),
--- a/mercurial/hgweb.py	Thu Nov 03 11:56:51 2005 +0900
+++ b/mercurial/hgweb.py	Thu Nov 03 14:19:54 2005 -0800
@@ -196,6 +196,11 @@
             self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10))
             self.allowpull = self.repo.ui.configbool("web", "allowpull", True)
 
+    def archivelist(self, nodeid):
+        for i in self.archives:
+            if self.repo.ui.configbool("web", "allow" + i, False):
+                yield {"type" : i, "node" : nodeid}
+
     def listfiles(self, files, mf):
         for f in files[:self.maxfiles]:
             yield self.t("filenodelink", node=hex(mf[f]), file=f)
@@ -414,11 +419,6 @@
         def diff(**map):
             yield self.diff(p1, n, None)
 
-        def archivelist():
-            for i in self.archives:
-                if self.repo.ui.configbool("web", "allow" + i, False):
-                    yield {"type" : i, "node" : nodeid}
-
         yield self.t('changeset',
                      diff=diff,
                      rev=cl.rev(n),
@@ -430,7 +430,7 @@
                      desc=changes[4],
                      date=changes[2],
                      files=files,
-                     archives=archivelist())
+                     archives=self.archivelist(nodeid))
 
     def filelog(self, f, filenode):
         cl = self.repo.changelog
@@ -618,7 +618,8 @@
                      path=path,
                      up=up(path),
                      fentries=filelist,
-                     dentries=dirlist)
+                     dentries=dirlist,
+                     archives=self.archivelist(hex(node)))
 
     def tags(self):
         cl = self.repo.changelog
--- a/mercurial/localrepo.py	Thu Nov 03 11:56:51 2005 +0900
+++ b/mercurial/localrepo.py	Thu Nov 03 14:19:54 2005 -0800
@@ -1504,9 +1504,6 @@
                 return 1
             branch_merge = True
 
-        if moddirstate:
-            self.dirstate.setparents(p1, p2)
-
         # get the files we don't need to change
         files = get.keys()
         files.sort()
@@ -1559,6 +1556,9 @@
             else:
                 self.dirstate.forget(remove)
 
+        if moddirstate:
+            self.dirstate.setparents(p1, p2)
+
     def merge3(self, fn, my, other):
         """perform a 3-way merge in the working directory"""
 
@@ -1602,6 +1602,9 @@
 
         seen = {}
         self.ui.status(_("checking changesets\n"))
+        d = self.changelog.checksize()
+        if d:
+            err(_("changeset data short %d bytes") % d)
         for i in range(self.changelog.count()):
             changesets += 1
             n = self.changelog.node(i)
@@ -1618,6 +1621,9 @@
                                  (short(n), short(p)))
             try:
                 changes = self.changelog.read(n)
+            except KeyboardInterrupt:
+                self.ui.warn(_("interrupted"))
+                raise
             except Exception, inst:
                 err(_("unpacking changeset %s: %s") % (short(n), inst))
 
@@ -1628,6 +1634,9 @@
 
         seen = {}
         self.ui.status(_("checking manifests\n"))
+        d = self.manifest.checksize()
+        if d:
+            err(_("manifest data short %d bytes") % d)
         for i in range(self.manifest.count()):
             n = self.manifest.node(i)
             l = self.manifest.linkrev(n)
@@ -1682,6 +1691,10 @@
             if f == "/dev/null": continue
             files += 1
             fl = self.file(f)
+            d = fl.checksize()
+            if d:
+                err(_("%s file data short %d bytes") % (f, d))
+
             nodes = { nullid: 1 }
             seen = {}
             for i in range(fl.count()):
@@ -1705,6 +1718,9 @@
                 # verify contents
                 try:
                     t = fl.read(n)
+                except KeyboardInterrupt:
+                    self.ui.warn(_("interrupted"))
+                    raise
                 except Exception, inst:
                     err(_("unpacking file %s %s: %s") % (f, short(n), inst))
 
--- a/mercurial/revlog.py	Thu Nov 03 11:56:51 2005 +0900
+++ b/mercurial/revlog.py	Thu Nov 03 14:19:54 2005 -0800
@@ -823,3 +823,19 @@
         dfh.close()
         ifh.close()
         return node
+
+    def checksize(self):
+        expected = 0
+        if self.count():
+            expected = self.end(self.count() - 1)
+        try:
+            f = self.opener(self.datafile)
+            f.seek(0, 2)
+            actual = f.tell()
+            return expected - actual
+        except IOError, inst:
+            if inst.errno == errno.ENOENT:
+                return 0
+            raise
+
+
--- a/templates/manifest.tmpl	Thu Nov 03 11:56:51 2005 +0900
+++ b/templates/manifest.tmpl	Thu Nov 03 14:19:54 2005 -0800
@@ -7,6 +7,7 @@
 <a href="?cl=#rev#">changelog</a>
 <a href="?tags=">tags</a>
 <a href="?cs=#node|short#">changeset</a>
+#archives%archiveentry#
 </div>
 
 <h2>manifest for changeset #node|short#: #path#</h2>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-permissions	Thu Nov 03 14:19:54 2005 -0800
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+hg init
+echo foo > a
+hg add a
+hg commit -m "1" -d "0 0"
+hg verify
+chmod -r .hg/data/a.d
+hg verify 2>/dev/null || echo verify failed
+chmod +r .hg/data/a.d
+hg verify 2>/dev/null || echo verify failed
+chmod -w .hg/data/a.d
+echo barber > a
+hg commit -m "2" -d "0 0" 2>/dev/null || echo commit failed
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-permissions.out	Thu Nov 03 14:19:54 2005 -0800
@@ -0,0 +1,16 @@
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+1 files, 1 changesets, 1 total revisions
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+verify failed
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+1 files, 1 changesets, 1 total revisions
+commit failed