merge with stable
authorMatt Mackall <mpm@selenic.com>
Wed, 02 Jul 2014 00:01:13 -0500
changeset 21832 4b93e19cd6e6
parent 21824 57c70d3ad1c9 (current diff)
parent 21831 2392b9e19366 (diff)
child 21833 c1ceec0c8cb4
merge with stable
hgext/rebase.py
mercurial/cmdutil.py
mercurial/tags.py
--- a/.hgsigs	Tue Jul 01 19:54:48 2014 -0500
+++ b/.hgsigs	Wed Jul 02 00:01:13 2014 -0500
@@ -89,3 +89,4 @@
 564f55b251224f16508dd1311452db7780dafe2b 0 iQIVAwUAU1BmFSBXgaxoKi1yAQJ2Aw//bjK++xJuZCIdktg/i5FxBwoxdbipfTkKsN/YjUwrEmroYM8IkqIsO+U54OGCYWr3NPJ3VS8wUQeJ+NF3ffcjmjC297R9J+X0c5G90DdQUYX44jG/tP8Tqpev4Q7DLCXT26aRwEMdJQpq0eGaqv55E5Cxnyt3RrLCqe7RjPresZFg7iYrro5nq8TGYwBhessHXnCix9QI0HtXiLpms+0UGz8Sbi9nEYW+M0OZCyO1TvykCpFzEsLNwqqtFvhOMD/AMiWcTKNUpjmOn3V83xjWl+jnDUt7BxJ7n1efUnlwl4IeWlSUb73q/durtaymb97cSdKFmXHv4pdAShQEuEpVVGO1WELsKoXmbj30ItTW2V3KvNbjFsvIdDo7zLCpXyTq1HC56W7QCIMINX2qT+hrAMWC12tPQ05f89Cv1+jpk6eOPFqIHFdi663AjyrnGll8nwN7HJWwtA5wTXisu3bec51FAq4yJTzPMtOE9spz36E+Go2hZ1cAv9oCSceZcM0wB8KiMfaZJKNZNZk1jvsdiio4CcdASOFQPOspz07GqQxVP7W+F1Oz32LgwcNAEAS/f3juwDj45GYfAWJrTh3dnJy5DTD2LVC7KtkxxUVkWkqxivnDB9anj++FN9eyekxzut5eFED+WrCfZMcSPW0ai7wbslhKUhCwSf/v3DgGwsM=
 2195ac506c6ababe86985b932f4948837c0891b5 0 iQIVAwUAU2LO/CBXgaxoKi1yAQI/3w/7BT/VRPyxey6tYp7i5cON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W7uw4=
--- a/.hgtags	Tue Jul 01 19:54:48 2014 -0500
+++ b/.hgtags	Wed Jul 02 00:01:13 2014 -0500
@@ -102,3 +102,4 @@
 564f55b251224f16508dd1311452db7780dafe2b 3.0-rc
 2195ac506c6ababe86985b932f4948837c0891b5 3.0
 269c80ee5b3cb3684fa8edc61501b3506d02eb10 3.0.1
+2d8cd3d0e83c7336c0cb45a9f88638363f993848 3.0.2
--- a/hgext/rebase.py	Tue Jul 01 19:54:48 2014 -0500
+++ b/hgext/rebase.py	Wed Jul 02 00:01:13 2014 -0500
@@ -343,7 +343,16 @@
                                   'resolve, then hg rebase --continue)'))
                     finally:
                         ui.setconfig('ui', 'forcemerge', '', 'rebase')
-                cmdutil.duplicatecopies(repo, rev, target)
+                if collapsef:
+                    cmdutil.duplicatecopies(repo, rev, target)
+                else:
+                    # If we're not using --collapse, we need to
+                    # duplicate copies between the revision we're
+                    # rebasing and its first parent, but *not*
+                    # duplicate any copies that have already been
+                    # performed in the destination.
+                    p1rev = repo[rev].p1().rev()
+                    cmdutil.duplicatecopies(repo, rev, p1rev, skiprev=target)
                 if not collapsef:
                     newrev = concludenode(repo, rev, p1, p2, extrafn=extrafn,
                                           editor=editor)
--- a/i18n/ja.po	Tue Jul 01 19:54:48 2014 -0500
+++ b/i18n/ja.po	Wed Jul 02 00:01:13 2014 -0500
@@ -149,8 +149,8 @@
 msgstr ""
 "Project-Id-Version: Mercurial\n"
 "Report-Msgid-Bugs-To: <mercurial-devel@selenic.com>\n"
-"POT-Creation-Date: 2014-05-30 19:32+0900\n"
-"PO-Revision-Date: 2014-05-30 19:43+0900\n"
+"POT-Creation-Date: 2014-06-30 18:45+0900\n"
+"PO-Revision-Date: 2014-06-30 19:03+0900\n"
 "Last-Translator: Japanese translation team <mercurial-ja@googlegroups.com>\n"
 "Language-Team: Japanese\n"
 "Language: ja\n"
@@ -15297,6 +15297,10 @@
 msgstr "別名コマンド '%s' には実行対象の記述がありません\n"
 
 #, python-format
+msgid "error in definition for alias '%s': %s\n"
+msgstr "別名コマンド '%s' の定義が不正です: %s\n"
+
+#, python-format
 msgid ""
 "error in definition for alias '%s': %s may only be given on the command "
 "line\n"
@@ -25204,8 +25208,8 @@
 msgstr "サブリポジトリの連携先が見つかりません"
 
 #, python-format
-msgid "warning: removing potentially hostile .hg/hgrc in '%s'"
-msgstr "警告: '%s' 中の .hg/hgrc は潜在的な問題となりえるため破棄します"
+msgid "warning: removing potentially hostile 'hgrc' in '%s'\n"
+msgstr "警告: 潜在的な問題となりえる '%s' 中の hgrc ファイルを破棄します\n"
 
 #, python-format
 msgid "unknown subrepo type %s"
--- a/i18n/pt_BR.po	Tue Jul 01 19:54:48 2014 -0500
+++ b/i18n/pt_BR.po	Wed Jul 02 00:01:13 2014 -0500
@@ -8265,13 +8265,13 @@
 msgid "empty \"rev\" revision set - nothing to rebase\n"
 msgstr "conjunto de revisões \"rev\" vazio - nada para rebasear\n"
 
-msgid "empty \"source\" revision set - nothing to rebase"
-msgstr "conjunto de revisões \"fonte\" vazio - nada para rebasear"
-
-msgid "empty \"base\" revision set - can't compute rebase set"
+msgid "empty \"source\" revision set - nothing to rebase\n"
+msgstr "conjunto de revisões \"fonte\" vazio - nada para rebasear\n"
+
+msgid "empty \"base\" revision set - can't compute rebase set\n"
 msgstr ""
 "conjunto de revisões \"base\" vazio - não é possível calcular o conjunto de "
-"rebaseamento"
+"rebaseamento\n"
 
 #, python-format
 msgid "nothing to rebase - %s is both \"base\" and destination\n"
@@ -15604,6 +15604,10 @@
 msgstr "nenhuma definição para o apelido '%s'\n"
 
 #, python-format
+msgid "error in definition for alias '%s': %s\n"
+msgstr "erro na definição do apelido '%s': %s\n"
+
+#, python-format
 msgid ""
 "error in definition for alias '%s': %s may only be given on the command "
 "line\n"
@@ -24133,31 +24137,35 @@
 msgid "note: possible conflict - %s was deleted and renamed to:\n"
 msgstr "nota: possível conflito - %s foi apagado e renomeado para:\n"
 
-#, fuzzy, python-format
+#, python-format
 msgid "note: merging %s and %s using bids from ancestors %s\n"
-msgstr ""
+msgstr "nota: mesclando %s e %s usando lances dos ancestrais %s\n"
 
 #, python-format
 msgid ""
 "\n"
 "calculating bids for ancestor %s\n"
 msgstr ""
+"\n"
+"calculando lances para o ancestral %s\n"
 
 msgid ""
 "\n"
 "auction for merging merge bids\n"
 msgstr ""
+"\n"
+"leilão para mesclar lances de mesclagem\n"
 
 #, python-format
 msgid " %s: multiple bids for merge action:\n"
-msgstr ""
+msgstr " %s: múltiplos lances para ação de mesclagem:\n"
 
 #, python-format
 msgid " %s: ambiguous merge - picked %s action\n"
-msgstr ""
+msgstr " %s: mesclagem ambígua - escolhida a ação %s\n"
 
 msgid "end of auction"
-msgstr ""
+msgstr "fim do leilão"
 
 #, python-format
 msgid ""
@@ -25737,8 +25745,8 @@
 msgstr "o caminho padrão para o sub-repositório não foi encontrado"
 
 #, python-format
-msgid "warning: removing potentially hostile .hg/hgrc in '%s'"
-msgstr "aviso: removendo .hg/hgrc potencialmente hostil em '%s'"
+msgid "warning: removing potentially hostile 'hgrc' in '%s'\n"
+msgstr "aviso: removendo 'hgrc' potencialmente hostil em '%s'\n"
 
 #, python-format
 msgid "unknown subrepo type %s"
--- a/mercurial/cmdutil.py	Tue Jul 01 19:54:48 2014 -0500
+++ b/mercurial/cmdutil.py	Wed Jul 02 00:01:13 2014 -0500
@@ -1944,11 +1944,22 @@
 
     return err
 
-def duplicatecopies(repo, rev, fromrev):
-    '''reproduce copies from fromrev to rev in the dirstate'''
+def duplicatecopies(repo, rev, fromrev, skiprev=None):
+    '''reproduce copies from fromrev to rev in the dirstate
+
+    If skiprev is specified, it's a revision that should be used to
+    filter copy records. Any copies that occur between fromrev and
+    skiprev will not be duplicated, even if they appear in the set of
+    copies between fromrev and rev.
+    '''
+    exclude = {}
+    if skiprev is not None:
+        exclude = copies.pathcopies(repo[fromrev], repo[skiprev])
     for dst, src in copies.pathcopies(repo[fromrev], repo[rev]).iteritems():
         # copies.pathcopies returns backward renames, so dst might not
         # actually be in the dirstate
+        if dst in exclude:
+            continue
         if repo.dirstate[dst] in "nma":
             repo.dirstate.copy(src, dst)
 
--- a/mercurial/tags.py	Tue Jul 01 19:54:48 2014 -0500
+++ b/mercurial/tags.py	Wed Jul 02 00:01:13 2014 -0500
@@ -73,6 +73,15 @@
     filetags = _readtags(
         ui, repo, data.splitlines(), "localtags",
         recode=encoding.fromlocal)
+
+    # remove tags pointing to invalid nodes
+    cl = repo.changelog
+    for t in filetags.keys():
+        try:
+            cl.rev(filetags[t][0])
+        except (LookupError, ValueError):
+            del filetags[t]
+
     _updatetags(filetags, "local", alltags, tagtypes)
 
 def _readtags(ui, repo, lines, fn, recode=None):
--- a/tests/test-obsolete.t	Tue Jul 01 19:54:48 2014 -0500
+++ b/tests/test-obsolete.t	Wed Jul 02 00:01:13 2014 -0500
@@ -907,3 +907,15 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     A
   
+Test that removing a local tag does not cause some commands to fail
+
+  $ hg tag -l -r tip tiptag
+  $ hg tags
+  tiptag                             2:3816541e5485
+  tip                                2:3816541e5485
+  visible                            0:193e9254ce7e
+  $ hg --config extensions.strip= strip -r tip --no-backup
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg tags
+  visible                            0:193e9254ce7e
+  tip                                0:193e9254ce7e
--- a/tests/test-rebase-rename.t	Tue Jul 01 19:54:48 2014 -0500
+++ b/tests/test-rebase-rename.t	Wed Jul 02 00:01:13 2014 -0500
@@ -240,3 +240,84 @@
    1 files changed, 1 insertions(+), 0 deletions(-)
 
   $ cd ..
+
+Verify that copies get preserved (issue4192).
+  $ hg init copy-gets-preserved
+  $ cd copy-gets-preserved
+
+  $ echo a > a
+  $ hg add a
+  $ hg commit --message "File a created"
+  $ hg copy a b
+  $ echo b > b
+  $ hg commit --message "File b created as copy of a and modified"
+  $ hg copy b c
+  $ echo c > c
+  $ hg commit --message "File c created as copy of b and modified"
+  $ hg copy c d
+  $ echo d > d
+  $ hg commit --message "File d created as copy of c and modified"
+
+Note that there are four entries in the log for d
+  $ hg tglog --follow d
+  @  3: 'File d created as copy of c and modified'
+  |
+  o  2: 'File c created as copy of b and modified'
+  |
+  o  1: 'File b created as copy of a and modified'
+  |
+  o  0: 'File a created'
+  
+Update back to before we performed copies, and inject an unrelated change.
+  $ hg update 0
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+
+  $ echo unrelated > unrelated
+  $ hg add unrelated
+  $ hg commit --message "Unrelated file created"
+  created new head
+  $ hg update 4
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Rebase the copies on top of the unrelated change.
+  $ hg rebase --source 1 --dest 4
+  saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/*.hg (glob)
+  $ hg update 4
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+There should still be four entries in the log for d
+  $ hg tglog --follow d
+  @  4: 'File d created as copy of c and modified'
+  |
+  o  3: 'File c created as copy of b and modified'
+  |
+  o  2: 'File b created as copy of a and modified'
+  |
+  o  0: 'File a created'
+  
+Same steps as above, but with --collapse on rebase to make sure the
+copy records collapse correctly.
+  $ hg co 1
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ echo more >> unrelated
+  $ hg ci -m 'unrelated commit is unrelated'
+  created new head
+  $ hg rebase -s 2 --dest 5 --collapse
+  merging b and c to c
+  merging c and d to d
+  saved backup bundle to $TESTTMP/copy-gets-preserved/.hg/*.hg (glob)
+  $ hg co tip
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+This should show both revision 3 and 0 since 'd' was transitively a
+copy of 'a'.
+
+  $ hg tglog --follow d
+  @  3: 'Collapsed revision
+  |  * File b created as copy of a and modified
+  |  * File c created as copy of b and modified
+  |  * File d created as copy of c and modified'
+  o  0: 'File a created'
+  
+
+  $ cd ..