changeset 20710:9c1665f36588

merge with default
author Matt Mackall <mpm@selenic.com>
date Thu, 13 Mar 2014 15:00:34 -0500
parents 71df845d86cf (current diff) 2764148aa088 (diff)
children b95490cf8abd
files mercurial/cmdutil.py
diffstat 9 files changed, 38 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/hgfixes/fix_bytesmod.py	Thu Mar 13 14:34:32 2014 -0500
+++ b/contrib/hgfixes/fix_bytesmod.py	Thu Mar 13 15:00:34 2014 -0500
@@ -37,7 +37,7 @@
             if self.filename.endswith(bfn):
                 return
         if not self.filename.endswith('mercurial/py3kcompat.py'):
-            touch_import('.', 'py3kcompat', node=node)
+            touch_import('mercurial', 'py3kcompat', node=node)
 
         formatstr = results['formatstr'].clone()
         data = results['data'].clone()
--- a/mercurial/cmdutil.py	Thu Mar 13 14:34:32 2014 -0500
+++ b/mercurial/cmdutil.py	Thu Mar 13 15:00:34 2014 -0500
@@ -1969,7 +1969,11 @@
 
             ph = repo.ui.config('phases', 'new-commit', phases.draft)
             try:
-                repo.ui.setconfig('phases', 'new-commit', old.phase())
+                if opts.get('secret'):
+                    commitphase = 'secret'
+                else:
+                    commitphase = old.phase()
+                repo.ui.setconfig('phases', 'new-commit', commitphase)
                 newid = repo.commitctx(new)
             finally:
                 repo.ui.setconfig('phases', 'new-commit', ph)
--- a/mercurial/commands.py	Thu Mar 13 14:34:32 2014 -0500
+++ b/mercurial/commands.py	Thu Mar 13 15:00:34 2014 -0500
@@ -1397,6 +1397,7 @@
         if opts.get('force_editor'):
             e = cmdutil.commitforceeditor
 
+        # commitfunc is used only for temporary amend commit by cmdutil.amend
         def commitfunc(ui, repo, message, match, opts):
             editor = e
             # message contains text from -m or -l, if it's empty,
@@ -1404,18 +1405,12 @@
             if not message:
                 message = old.description()
                 editor = cmdutil.commitforceeditor
-            try:
-                if opts.get('secret'):
-                    ui.setconfig('phases', 'new-commit', 'secret')
-
-                return repo.commit(message,
-                                   opts.get('user') or old.user(),
-                                   opts.get('date') or old.date(),
-                                   match,
-                                   editor=editor,
-                                   extra=extra)
-            finally:
-                ui.setconfig('phases', 'new-commit', oldcommitphase)
+            return repo.commit(message,
+                               opts.get('user') or old.user(),
+                               opts.get('date') or old.date(),
+                               match,
+                               editor=editor,
+                               extra=extra)
 
         current = repo._bookmarkcurrent
         marks = old.bookmarks()
--- a/mercurial/scmutil.py	Thu Mar 13 14:34:32 2014 -0500
+++ b/mercurial/scmutil.py	Thu Mar 13 15:00:34 2014 -0500
@@ -506,7 +506,7 @@
                 start, end = spec.split(_revrangesep, 1)
                 start = revfix(repo, start, 0)
                 end = revfix(repo, end, len(repo) - 1)
-                if end == nullrev and start <= 0:
+                if end == nullrev and start < 0:
                     start = nullrev
                 rangeiter = repo.changelog.revs(start, end)
                 if not seen and not l:
--- a/setup.py	Thu Mar 13 14:34:32 2014 -0500
+++ b/setup.py	Thu Mar 13 15:00:34 2014 -0500
@@ -24,7 +24,7 @@
     def printf(*args, **kwargs):
         f = kwargs.get('file', sys.stdout)
         end = kwargs.get('end', '\n')
-        f.write(b' '.join(args) + end)
+        f.write(b(' ').join(args) + end)
 
 # Solaris Python packaging brain damage
 try:
--- a/tests/killdaemons.py	Thu Mar 13 14:34:32 2014 -0500
+++ b/tests/killdaemons.py	Thu Mar 13 15:00:34 2014 -0500
@@ -16,7 +16,7 @@
         logfn('# Killing daemon process %d' % pid)
         PROCESS_TERMINATE = 1
         PROCESS_QUERY_INFORMATION = 0x400
-        SYNCHRONIZE = 0x00100000L
+        SYNCHRONIZE = 0x00100000
         WAIT_OBJECT_0 = 0
         WAIT_TIMEOUT = 258
         handle = ctypes.windll.kernel32.OpenProcess(
@@ -89,4 +89,3 @@
 if __name__ == '__main__':
     path, = sys.argv[1:]
     killdaemons(path)
-
--- a/tests/test-commit-amend.t	Thu Mar 13 14:34:32 2014 -0500
+++ b/tests/test-commit-amend.t	Thu Mar 13 15:00:34 2014 -0500
@@ -765,3 +765,14 @@
   $ hg ci --close-branch -m'open and close'
   abort: can only close branch heads
   [255]
+
+Test that amend with --secret creates new secret changeset forcibly
+---------------------------------------------------------------------
+
+  $ hg phase '.^::.'
+  35: draft
+  36: draft
+  $ hg commit --amend --secret -m 'amend as secret' -q
+  $ hg phase '.^::.'
+  35: draft
+  38: secret
--- a/tests/test-glog.t	Thu Mar 13 14:34:32 2014 -0500
+++ b/tests/test-glog.t	Thu Mar 13 15:00:34 2014 -0500
@@ -2111,6 +2111,11 @@
 issue3772
 
   $ hg log -G -r :null
+  o  changeset:   0:f8035bb17114
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add a
+  |
   o  changeset:   -1:000000000000
      user:
      date:        Thu Jan 01 00:00:00 1970 +0000
--- a/tests/test-log.t	Thu Mar 13 14:34:32 2014 -0500
+++ b/tests/test-log.t	Thu Mar 13 15:00:34 2014 -0500
@@ -1356,6 +1356,12 @@
 issue3772: hg log -r :null showing revision 0 as well
 
   $ hg log -r :null
+  changeset:   0:65624cd9070a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a bunch of weird directories
+  
   changeset:   -1:000000000000
   user:        
   date:        Thu Jan 01 00:00:00 1970 +0000