Merge with stable
authorMartin Geisler <mg@aragost.com>
Mon, 31 May 2010 13:55:47 +0200
changeset 11238 a5922547b5cc
parent 11234 1ebe048902d9 (current diff)
parent 11237 feb2a58fc592 (diff)
child 11241 258c98567aff
Merge with stable
hgext/record.py
tests/test-record
tests/test-record.out
--- a/hgext/record.py	Sun May 30 23:24:10 2010 +0200
+++ b/hgext/record.py	Mon May 31 13:55:47 2010 +0200
@@ -296,9 +296,9 @@
             ui.write("\n")
             if r == 7: # ?
                 doc = gettext(record.__doc__)
-                c = doc.find(_('y - record this change'))
+                c = doc.find('::') + 2
                 for l in doc[c:].splitlines():
-                    if l:
+                    if l.startswith('      '):
                         ui.write(l.strip(), '\n')
                 continue
             elif r == 0: # yes
@@ -380,7 +380,9 @@
       a - record all changes to all remaining files
       q - quit, recording no changes
 
-      ? - display help'''
+      ? - display help
+
+    This command is not available when committing a merge.'''
 
     dorecord(ui, repo, commands.commit, *pats, **opts)
 
@@ -419,10 +421,15 @@
         After the actual job is done by non-interactive command, working dir
         state is restored to original.
 
-        In the end we'll record intresting changes, and everything else will be
+        In the end we'll record interesting changes, and everything else will be
         left in place, so the user can continue his work.
         """
 
+        merge = len(repo[None].parents()) > 1
+        if merge:
+            raise util.Abort(_('cannot partially commit a merge '
+                               '(use hg commit instead)'))
+
         changes = repo.status(match=match)[:3]
         diffopts = mdiff.diffopts(git=True, nodates=True)
         chunks = patch.diff(repo, changes=changes, opts=diffopts)
--- a/tests/test-record	Sun May 30 23:24:10 2010 +0200
+++ b/tests/test-record	Mon May 31 13:55:47 2010 +0200
@@ -301,9 +301,20 @@
 EOF
 echo; hg tip --config diff.git=True -p
 
+cd ..
+
+echo % abort early when a merge is in progress
+hg up 4
+touch iwillmergethat
+hg add iwillmergethat
+hg branch thatbranch
+hg ci -m'new head'
+hg up default
+hg merge thatbranch
+echo; hg record -m'will abort'
+hg up -C
 
 echo % with win32ext
-cd ..
 echo '[extensions]' >> .hg/hgrc
 echo 'win32text = ' >> .hg/hgrc
 echo '[decode]' >> .hg/hgrc
--- a/tests/test-record.out	Sun May 30 23:24:10 2010 +0200
+++ b/tests/test-record.out	Mon May 31 13:55:47 2010 +0200
@@ -24,6 +24,8 @@
 
       ? - display help
 
+    This command is not available when committing a merge.
+
 options:
 
  -A --addremove     mark new/missing files as added/removed before committing
@@ -626,6 +628,15 @@
  b
 +c
 
+% abort early when a merge is in progress
+1 files updated, 0 files merged, 5 files removed, 0 files unresolved
+marked working directory as branch thatbranch
+5 files updated, 0 files merged, 2 files removed, 0 files unresolved
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+
+abort: cannot partially commit a merge (use hg commit instead)
+0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 % with win32ext
 diff --git a/subdir/f1 b/subdir/f1
 1 hunks, 1 lines changed
@@ -637,8 +648,9 @@
 +d
 record this change to 'subdir/f1'? [Ynsfdaq?] 
 
-changeset:   25:5bacc1f6e9cf
+changeset:   26:5bacc1f6e9cf
 tag:         tip
+parent:      24:1460f6e47966
 user:        test
 date:        Thu Jan 01 00:00:23 1970 +0000
 summary:     w1