changeset 2083:345107e167a0

merge 0.8.1 with revlogng
author Chris Mason <mason@suse.com>
date Sat, 08 Apr 2006 20:10:46 -0400
parents 856f0ba200bc (current diff) c0b945c5df08 (diff)
children d66278012853
files mercurial/commands.py mercurial/mpatch.c mercurial/util.py
diffstat 10 files changed, 49 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Sat Apr 08 20:08:06 2006 -0400
+++ b/.hgtags	Sat Apr 08 20:10:46 2006 -0400
@@ -9,3 +9,4 @@
 eac9c8efcd9bd8244e72fb6821f769f450457a32 0.6c
 979c049974485125e1f9357f6bbe9c1b548a64c3 0.7
 3a56574f329a368d645853e0f9e09472aee62349 0.8
+6a03cff2b0f5d30281e6addefe96b993582f2eac 0.8.1
--- a/hgext/mq.py	Sat Apr 08 20:08:06 2006 -0400
+++ b/hgext/mq.py	Sat Apr 08 20:10:46 2006 -0400
@@ -14,6 +14,7 @@
 
 repomap = {}
 
+commands.norepo += " qversion"
 class queue:
     def __init__(self, ui, path, patchdir=None):
         self.basepath = path
--- a/hgmerge	Sat Apr 08 20:08:06 2006 -0400
+++ b/hgmerge	Sat Apr 08 20:10:46 2006 -0400
@@ -47,6 +47,11 @@
 type "$TKDIFF"    >/dev/null 2>&1 || TKDIFF=
 type "$MELD"      >/dev/null 2>&1 || MELD=
 
+# Hack for Solaris
+TEST="/usr/bin/test"
+type "$TEST" >/dev/null 2>&1 || TEST="/bin/test"
+type "$TEST" >/dev/null 2>&1 || TEST="test"
+
 # random part of names
 RAND="$RANDOM$RANDOM"
 
@@ -118,7 +123,7 @@
     # filemerge prefers the right by default
     $FILEMERGE -left "$OTHER" -right "$LOCAL" -ancestor "$BASE" -merge "$LOCAL"
     [ $? -ne 0 ] && echo "FileMerge failed to launch" && failure
-    test "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
+    $TEST "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
 fi
 
 if [ -n "$DISPLAY" ]; then
@@ -142,7 +147,7 @@
         # use the file with conflicts
         $MELD "$LOCAL.tmp.$RAND" "$LOCAL" "$OTHER" || failure
         # Also it doesn't return good error code
-        test "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
+        $TEST "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
     fi
 fi
 
@@ -153,7 +158,7 @@
     $EDITOR "$LOCAL" || failure
     # Some editors do not return meaningful error codes
     # Do not take any chances
-    test "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
+    $TEST "$LOCAL" -nt "$CHGTEST" && success || ask_if_merged
 fi
 
 # attempt to manually merge with diff and patch
@@ -170,7 +175,7 @@
     else
         # If rejects are empty after using the editor, merge was ok
         $EDITOR "$LOCAL" "$LOCAL.rej" || failure
-        test -s "$LOCAL.rej" || success
+        $TEST -s "$LOCAL.rej" || success
     fi
     failure
 fi
--- a/mercurial/commands.py	Sat Apr 08 20:08:06 2006 -0400
+++ b/mercurial/commands.py	Sat Apr 08 20:10:46 2006 -0400
@@ -2390,7 +2390,7 @@
         #   make backup if in target manifest
         #   make backup if not in target manifest
         (modified, revert, remove, True, True),
-        (added, revert, forget, True, True),
+        (added, revert, forget, True, False),
         (removed, undelete, None, False, False),
         (deleted, revert, remove, False, False),
         (unknown, add, None, True, False),
@@ -2757,7 +2757,9 @@
 
     This command is not intended for use on public repositories. Once
     a change is visible for pull by other users, undoing it locally is
-    ineffective.
+    ineffective. Furthemore a race is possible with readers of the
+    repository, for example an ongoing pull from the repository will
+    fail and rollback.
     """
     repo.undo()
 
@@ -2992,12 +2994,10 @@
          _('hg log [OPTION]... [FILE]')),
     "manifest": (manifest, [], _('hg manifest [REV]')),
     "merge":
-    (merge,
-     [('b', 'branch', '', _('merge with head of a specific branch')),
-      ('', 'style', '', _('display using template map file')),
-      ('f', 'force', None, _('force a merge with outstanding changes')),
-      ('', 'template', '', _('display with template'))],
-     _('hg merge [-b TAG] [-f] [REV]')),
+        (merge,
+         [('b', 'branch', '', _('merge with head of a specific branch')),
+          ('f', 'force', None, _('force a merge with outstanding changes'))],
+         _('hg merge [-b TAG] [-f] [REV]')),
     "outgoing|out": (outgoing,
          [('M', 'no-merges', None, _('do not show merges')),
           ('f', 'force', None,
@@ -3123,11 +3123,9 @@
     "^update|up|checkout|co":
         (update,
          [('b', 'branch', '', _('checkout the head of a specific branch')),
-          ('', 'style', '', _('display using template map file')),
           ('m', 'merge', None, _('allow merging of branches')),
           ('C', 'clean', None, _('overwrite locally modified files')),
-          ('f', 'force', None, _('force a merge with outstanding changes')),
-          ('', 'template', '', _('display with template'))],
+          ('f', 'force', None, _('force a merge with outstanding changes'))],
          _('hg update [-b TAG] [-m] [-C] [-f] [REV]')),
     "verify": (verify, [], _('hg verify')),
     "version": (show_version, [], _('hg version')),
@@ -3157,22 +3155,26 @@
 def findpossible(cmd):
     """
     Return cmd -> (aliases, command table entry)
-    for each matching command
+    for each matching command.
+    Return debug commands (or their aliases) only if no normal command matches.
     """
     choice = {}
     debugchoice = {}
     for e in table.keys():
         aliases = e.lstrip("^").split("|")
+        found = None
         if cmd in aliases:
-            choice[cmd] = (aliases, table[e])
-            continue
-        for a in aliases:
-            if a.startswith(cmd):
-                if aliases[0].startswith("debug"):
-                    debugchoice[a] = (aliases, table[e])
-                else:
-                    choice[a] = (aliases, table[e])
-                break
+            found = cmd
+        else:
+            for a in aliases:
+                if a.startswith(cmd):
+                    found = a
+                    break
+        if found is not None:
+            if aliases[0].startswith("debug"):
+                debugchoice[found] = (aliases, table[e])
+            else:
+                choice[found] = (aliases, table[e])
 
     if not choice and debugchoice:
         choice = debugchoice
--- a/mercurial/mpatch.c	Sat Apr 08 20:08:06 2006 -0400
+++ b/mercurial/mpatch.c	Sat Apr 08 20:10:46 2006 -0400
@@ -61,12 +61,12 @@
 	a = (struct flist *)malloc(sizeof(struct flist));
 	if (a) {
 		a->base = (struct frag *)malloc(sizeof(struct frag) * size);
-		if (!a->base) {
-			free(a);
-			a = NULL;
-		} else
+		if (a->base) {
 			a->head = a->tail = a->base;
-		return a;
+			return a;
+		}
+		free(a);
+		a = NULL;
 	}
 	if (!PyErr_Occurred())
 		PyErr_NoMemory();
--- a/mercurial/sshrepo.py	Sat Apr 08 20:08:06 2006 -0400
+++ b/mercurial/sshrepo.py	Sat Apr 08 20:10:46 2006 -0400
@@ -40,19 +40,19 @@
         r = self.do_cmd("between", pairs=("%s-%s" % ("0"*40, "0"*40)))
         l1 = ""
         l2 = "dummy"
-        max_noise = 100
+        max_noise = 500
         while l2 and max_noise:
             l2 = r.readline()
             self.readerr()
             if l1 == "1\n" and l2 == "\n":
                 break
             if l1:
-                ui.status(_("remote: %s") % l1)
+                ui.debug(_("remote: "), l1)
             l1 = l2
             max_noise -= 1
         else:
             if l1:
-                ui.status(_("remote: %s") % l1)
+                ui.debug(_("remote: "), l1)
             raise hg.RepoError(_("no response from remote hg"))
 
     def readerr(self):
--- a/mercurial/util.py	Sat Apr 08 20:08:06 2006 -0400
+++ b/mercurial/util.py	Sat Apr 08 20:10:46 2006 -0400
@@ -393,7 +393,7 @@
         if hardlink:
             try:
                 os_link(src, dst)
-            except:
+            except (IOError, OSError):
                 hardlink = False
                 shutil.copy(src, dst)
         else:
--- a/tests/test-confused-revert.out	Sat Apr 08 20:08:06 2006 -0400
+++ b/tests/test-confused-revert.out	Sat Apr 08 20:10:46 2006 -0400
@@ -6,19 +6,16 @@
 forgetting b
 %%% should show b unknown and a back to normal
 ? b
-? b.orig
 merging a
 %%% should show foo-b
 foo-b
 %%% should show a removed and b added
 A b
 R a
-? b.orig
 reverting...
 undeleting a
 forgetting b
 %%% should show b unknown and a marked modified (merged)
 ? b
-? b.orig
 %%% should show foo-b
 foo-b
--- a/tests/test-revert	Sat Apr 08 20:08:06 2006 -0400
+++ b/tests/test-revert	Sat Apr 08 20:10:46 2006 -0400
@@ -22,12 +22,12 @@
 echo %% should show b added, copy saved, and c modified
 hg status
 hg revert b
-echo %% should show b unknown, b.orig unknown, and c modified
+echo %% should show b unknown, and c modified
 hg status
 hg revert --no-backup c
-echo %% should show unknown: b b.orig
+echo %% should show unknown: b
 hg status
-echo %% should show a b b.orig c e
+echo %% should show a b c e
 ls
 echo %% should verbosely save backup to e.orig
 echo z > e
--- a/tests/test-revert.out	Sat Apr 08 20:08:06 2006 -0400
+++ b/tests/test-revert.out	Sat Apr 08 20:10:46 2006 -0400
@@ -13,17 +13,14 @@
 %% should show b added, copy saved, and c modified
 M c
 A b
-%% should show b unknown, b.orig unknown, and c modified
+%% should show b unknown, and c modified
 M c
 ? b
-? b.orig
-%% should show unknown: b b.orig
+%% should show unknown: b
 ? b
-? b.orig
-%% should show a b b.orig c e
+%% should show a b c e
 a
 b
-b.orig
 c
 e
 %% should verbosely save backup to e.orig
@@ -40,7 +37,6 @@
 notfound: No such file in rev 095eacd0c0d7
 A z
 ? b
-? b.orig
 ? e.orig
 %% should add a, forget z
 adding a