changeset 8927:288ba6d6c5c7

Merge with i18n
author Matt Mackall <mpm@selenic.com>
date Tue, 23 Jun 2009 15:43:09 -0500
parents e9ef409e6399 (diff) 5f6e1d5a2fbe (current diff)
children 1e16f9b21ce4 4df5d07fb532
files mercurial/commands.py
diffstat 18 files changed, 171 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/buildrpm	Mon Jun 22 15:58:22 2009 -0300
+++ b/contrib/buildrpm	Tue Jun 23 15:43:09 2009 -0500
@@ -51,7 +51,7 @@
 
 cat <<EOF >> $tmpspec
 %changelog
-* `date +'%a %b %d %Y'` `$HG showconfig ui.username` $version-$release
+* `LANG=en_US date +'%a %b %d %Y'` `$HG showconfig ui.username` $version-$release
 - Automatically built via $0
 
 EOF
--- a/contrib/mercurial.spec	Mon Jun 22 15:58:22 2009 -0300
+++ b/contrib/mercurial.spec	Tue Jun 23 15:43:09 2009 -0500
@@ -17,7 +17,7 @@
 # python-devel provides an adequate python-dev.  The merge tool is a
 # run-time dependency.
 #
-BuildRequires: python >= 2.3, python-devel, make, gcc, asciidoc, xmlto
+BuildRequires: python >= 2.4, python-devel, make, gcc, asciidoc, xmlto
 
 %define pythonver %(python -c 'import sys;print ".".join(map(str, sys.version_info[:2]))')
 %define pythonlib %{_libdir}/python%{pythonver}/site-packages/%{name}
--- a/doc/hgrc.5.txt	Mon Jun 22 15:58:22 2009 -0300
+++ b/doc/hgrc.5.txt	Tue Jun 23 15:43:09 2009 -0500
@@ -75,8 +75,8 @@
 SYNTAX
 ------
 
-A configuration file consists of sections, led by a "[section]" header
-and followed by "name: value" entries; "name=value" is also accepted.
+A configuration file consists of sections, led by a "`[section]`" header
+and followed by "`name: value`" entries; "`name=value`" is also accepted.
 
     [spam]
     eggs=ham
@@ -88,10 +88,7 @@
 
 Leading whitespace is removed from values. Empty lines are skipped.
 
-The optional values can contain format strings which refer to other
-values in the same section, or values in a special DEFAULT section.
-
-Lines beginning with "#" or ";" are ignored and may be used to provide
+Lines beginning with "`#`" or "`;`" are ignored and may be used to provide
 comments.
 
 SECTIONS
@@ -150,9 +147,9 @@
 Supported arguments:
 
   prefix;;
-    Either "++\*++" or a URI prefix with or without the scheme part.
+    Either "\*" or a URI prefix with or without the scheme part.
     The authentication entry with the longest matching prefix is used
-    (where "++*++" matches everything and counts as a match of length
+    (where "*" matches everything and counts as a match of length
     1). If the prefix doesn't include a scheme, the match is performed
     against the URI with its scheme stripped as well, and the schemes
     argument, q.v., is then subsequently consulted.
@@ -189,8 +186,8 @@
 Filters consist of a filter pattern followed by a filter command.
 Filter patterns are globs by default, rooted at the repository root.
 For example, to match any file ending in "`.txt`" in the root
-directory only, use the pattern "++\*.txt++". To match any file ending
-in "`.c`" anywhere in the repository, use the pattern "++**.c++".
+directory only, use the pattern "\*.txt". To match any file ending
+in "`.c`" anywhere in the repository, use the pattern "**`.c`".
 
 The filter command can start with a specifier, either "pipe:" or
 "tempfile:". If no specifier is given, "pipe:" is used by default.
@@ -331,16 +328,16 @@
 +
 --
 If you know that the extension is already in Python's search path,
-you can give the name of the module, followed by "=", with nothing
-after the "=".
+you can give the name of the module, followed by "`=`", with nothing
+after the "`=`".
 
-Otherwise, give a name that you choose, followed by "=", followed by
-the path to the ".py" file (including the file name extension) that
+Otherwise, give a name that you choose, followed by "`=`", followed by
+the path to the "`.py`" file (including the file name extension) that
 defines the extension.
 
 To explicitly disable an extension that is enabled in an hgrc of
-broader scope, prepend its path with '!', as in
-'hgext.foo = !/ext/path' or 'hgext.foo = !' when path is not
+broader scope, prepend its path with "`!`", as in
+"`hgext.foo = !/ext/path`" or "`hgext.foo = !`"  when path is not
 supplied.
 
 Example for `~/.hgrc`:
@@ -760,10 +757,10 @@
     Warn if a `.hg/hgrc` file is ignored due to not being owned by a
     trusted user or group. True or False. Default is True.
   slash;;
-    Display paths using a slash ("++/++") as the path separator. This
+    Display paths using a slash ("`/`") as the path separator. This
     only makes a difference on systems where the default path
     separator is not the slash character (e.g. Windows uses the
-    backslash character ("++\++")).
+    backslash character ("`\`")).
     Default is False.
   ssh;;
     command to use for SSH connections. Default is 'ssh'.
--- a/hgext/mq.py	Mon Jun 22 15:58:22 2009 -0300
+++ b/hgext/mq.py	Tue Jun 23 15:43:09 2009 -0500
@@ -1641,16 +1641,14 @@
 def delete(ui, repo, *patches, **opts):
     """remove patches from queue
 
-    The patches must not be applied, unless they are arguments to the
-    -r/--rev parameter. At least one patch or revision is required.
-
-    With --rev, mq will stop managing the named revisions (converting
-    them to regular Mercurial changesets). The qfinish command should
-    be used as an alternative for qdelete -r, as the latter option is
-    deprecated.
+    The patches must not be applied, and at least one patch is
+    required.
 
     With -k/--keep, the patch files are preserved in the patch
-    directory."""
+    directory.
+
+    To stop managing a patch and move it into permanent history,
+    use the qfinish command."""
     q = repo.mq
     q.delete(repo, patches, opts)
     q.save_dirty()
@@ -2520,7 +2518,7 @@
     "qdelete|qremove|qrm":
         (delete,
          [('k', 'keep', None, _('keep patch file')),
-          ('r', 'rev', [], _('stop managing a revision'))],
+          ('r', 'rev', [], _('stop managing a revision (DEPRECATED)'))],
          _('hg qdelete [-k] [-r REV]... [PATCH]...')),
     'qfold':
         (fold,
--- a/mercurial/commands.py	Mon Jun 22 15:58:22 2009 -0300
+++ b/mercurial/commands.py	Tue Jun 23 15:43:09 2009 -0500
@@ -24,7 +24,7 @@
     repository.
 
     The files will be added to the repository at the next commit. To
-    undo an add before that, see hg revert.
+    undo an add before that, see hg forget.
 
     If no names are given, add all files to the repository.
     """
@@ -482,9 +482,11 @@
     If no destination repository is specified the destination is
     assumed to have all the nodes specified by one or more --base
     parameters. To create a bundle containing all changesets, use
-    -a/--all (or --base null). To change the compression method
-    applied, use the -t/--type option (by default, bundles are
-    compressed using bz2).
+    -a/--all (or --base null).
+
+    To change the compression method applied, use the -t/--type
+    option. The available compression methods are: none, bzip2, and
+    gzip (by default, bundles are compressed using bzip2).
 
     The bundle file can then be transferred using conventional means
     and applied to another repository with the unbundle or pull
@@ -1138,6 +1140,37 @@
                  switch_parent=opts.get('switch_parent'),
                  opts=patch.diffopts(ui, opts))
 
+def forget(ui, repo, *pats, **opts):
+    """forget the specified files on the next commit
+
+    Mark the specified files so they will no longer be tracked
+    after the next commit.
+
+    This only removes files from the current branch, not from the
+    entire project history, and it does not delete them from the
+    working directory.
+
+    To undo a forget before the next commit, see hg add.
+    """
+
+    if not pats:
+        raise util.Abort(_('no files specified'))
+
+    m = cmdutil.match(repo, pats, opts)
+    s = repo.status(match=m, clean=True)
+    forget = sorted(s[0] + s[1] + s[3] + s[6])
+
+    for f in m.files():
+        if f not in repo.dirstate and not os.path.isdir(m.rel(f)):
+            ui.warn(_('not removing %s: file is already untracked\n')
+                    % m.rel(f))
+
+    for f in forget:
+        if ui.verbose or not m.exact(f):
+            ui.status(_('removing %s\n') % m.rel(f))
+
+    repo.remove(forget, unlink=False)
+
 def grep(ui, repo, pattern, *pats, **opts):
     """search for a pattern in specified files and revisions
 
@@ -3268,6 +3301,10 @@
           ('', 'switch-parent', None, _('diff against the second parent'))
           ] + diffopts,
          _('[OPTION]... [-o OUTFILESPEC] REV...')),
+    "^forget":
+        (forget,
+         [] + walkopts,
+         _('[OPTION]... FILE...')),
     "grep":
         (grep,
          [('0', 'print0', None, _('end fields with NUL')),
--- a/mercurial/hg.py	Mon Jun 22 15:58:22 2009 -0300
+++ b/mercurial/hg.py	Tue Jun 23 15:43:09 2009 -0500
@@ -231,6 +231,7 @@
                 copy = False
 
         if copy:
+            src_repo.hook('preoutgoing', throw=True, source='clone')
             hgdir = os.path.realpath(os.path.join(dest, ".hg"))
             if not os.path.exists(dest):
                 os.mkdir(dest)
@@ -262,7 +263,7 @@
             # we need to re-init the repo after manually copying the data
             # into it
             dest_repo = repository(ui, dest)
-
+            src_repo.hook('outgoing', source='clone', node='0'*40)
         else:
             try:
                 dest_repo = repository(ui, dest, create=True)
--- a/tests/test-add	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-add	Tue Jun 23 15:43:09 2009 -0500
@@ -7,6 +7,9 @@
 hg st
 hg add
 hg st
+hg forget a
+hg add
+hg st
 
 echo b > b
 hg add -n b
@@ -36,6 +39,9 @@
 hg ci -m merge
 
 echo % issue683
+hg forget a
+hg add a
+hg st
 hg rm a
 hg st
 echo a > a
--- a/tests/test-add.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-add.out	Tue Jun 23 15:43:09 2009 -0500
@@ -2,6 +2,8 @@
 ? a
 adding a
 A a
+adding a
+A a
 A a
 ? b
 A a
@@ -26,6 +28,7 @@
 M a
 ? a.orig
 % issue683
+? a.orig
 R a
 ? a.orig
 M a
--- a/tests/test-debugcomplete.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-debugcomplete.out	Tue Jun 23 15:43:09 2009 -0500
@@ -14,6 +14,7 @@
 copy
 diff
 export
+forget
 grep
 heads
 help
@@ -167,6 +168,7 @@
 commit: addremove, close-branch, include, exclude, message, logfile, date, user
 diff: rev, change, text, git, nodates, show-function, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, include, exclude
 export: output, switch-parent, text, git, nodates
+forget: include, exclude
 init: ssh, remotecmd
 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, prune, patch, git, limit, no-merges, style, template, include, exclude
 merge: force, rev, preview
--- a/tests/test-globalopts.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-globalopts.out	Tue Jun 23 15:43:09 2009 -0500
@@ -164,6 +164,7 @@
  copy         mark files as copied for the next commit
  diff         diff repository (or selected files)
  export       dump the header and diffs for one or more changesets
+ forget       forget the specified files on the next commit
  grep         search for a pattern in specified files and revisions
  heads        show current repository heads or show branch heads
  help         show help for a given topic or a help overview
@@ -230,6 +231,7 @@
  copy         mark files as copied for the next commit
  diff         diff repository (or selected files)
  export       dump the header and diffs for one or more changesets
+ forget       forget the specified files on the next commit
  grep         search for a pattern in specified files and revisions
  heads        show current repository heads or show branch heads
  help         show help for a given topic or a help overview
--- a/tests/test-grep	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-grep	Tue Jun 23 15:43:09 2009 -0500
@@ -73,8 +73,8 @@
 # Used to crash here
 hg grep -r 1 octarine
 
-# Issue337: grep did not compared changesets by their revision numbers
-# instead of following parent-child relationships.
+# Issue337: test that grep follows parent-child relationships instead
+# of just using revision numbers.
 cd ..
 echo % issue 337
 hg init issue337
--- a/tests/test-help.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-help.out	Tue Jun 23 15:43:09 2009 -0500
@@ -8,6 +8,7 @@
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
+ forget     forget the specified files on the next commit
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision
@@ -26,6 +27,7 @@
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
+ forget     forget the specified files on the next commit
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision
@@ -55,6 +57,7 @@
  copy         mark files as copied for the next commit
  diff         diff repository (or selected files)
  export       dump the header and diffs for one or more changesets
+ forget       forget the specified files on the next commit
  grep         search for a pattern in specified files and revisions
  heads        show current repository heads or show branch heads
  help         show help for a given topic or a help overview
@@ -117,6 +120,7 @@
  copy         mark files as copied for the next commit
  diff         diff repository (or selected files)
  export       dump the header and diffs for one or more changesets
+ forget       forget the specified files on the next commit
  grep         search for a pattern in specified files and revisions
  heads        show current repository heads or show branch heads
  help         show help for a given topic or a help overview
@@ -170,7 +174,7 @@
     repository.
 
     The files will be added to the repository at the next commit. To
-    undo an add before that, see hg revert.
+    undo an add before that, see hg forget.
 
     If no names are given, add all files to the repository.
 
@@ -190,7 +194,7 @@
     repository.
 
     The files will be added to the repository at the next commit. To
-    undo an add before that, see hg revert.
+    undo an add before that, see hg forget.
 
     If no names are given, add all files to the repository.
 
@@ -309,6 +313,7 @@
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
+ forget     forget the specified files on the next commit
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision
@@ -332,6 +337,7 @@
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
+ forget     forget the specified files on the next commit
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision
--- a/tests/test-hook	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-hook	Tue Jun 23 15:43:09 2009 -0500
@@ -107,6 +107,19 @@
 echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> ../a/.hg/hgrc
 hg pull ../a
 
+# outgoing hooks work for local clones
+cd ..
+echo '[hooks]' > a/.hg/hgrc
+echo 'preoutgoing = python ../printenv.py preoutgoing' >> a/.hg/hgrc
+echo 'outgoing = python ../printenv.py outgoing' >> a/.hg/hgrc
+hg clone a c
+rm -rf c
+
+# preoutgoing hook can prevent outgoing changes for local clones
+echo 'preoutgoing.forbid = python ../printenv.py preoutgoing.forbid 1' >> a/.hg/hgrc
+hg clone a zzz
+cd b
+
 cat > hooktests.py <<EOF
 from mercurial import util
 
--- a/tests/test-hook.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-hook.out	Tue Jun 23 15:43:09 2009 -0500
@@ -107,6 +107,13 @@
 pulling from ../a
 searching for changes
 abort: preoutgoing.forbid hook exited with status 1
+preoutgoing hook: HG_SOURCE=clone 
+outgoing hook: HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone 
+updating working directory
+3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+preoutgoing hook: HG_SOURCE=clone 
+preoutgoing.forbid hook: HG_SOURCE=clone 
+abort: preoutgoing.forbid hook exited with status 1
 # test python hooks
 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
 error: preoutgoing.raise hook raised an exception: exception from hook
--- a/tests/test-merge-tools	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-merge-tools	Tue Jun 23 15:43:09 2009 -0500
@@ -121,6 +121,20 @@
 echo "# ui.merge specifies internal:other:"
 domerge -r 2 --config ui.merge=internal:other
 
+echo "# ui.merge specifies internal:prompt:"
+domerge -r 2 --config ui.merge=internal:prompt
+
+echo "# ui.merge specifies internal:dump:"
+domerge -r 2 --config ui.merge=internal:dump
+echo f.base:
+cat f.base
+echo f.local:
+cat f.local
+echo f.other:
+cat f.other
+rm f.base f.local f.other
+echo
+
 echo "# ui.merge specifies internal:other but is overruled by pattern for false:"
 domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false
 
--- a/tests/test-merge-tools.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-merge-tools.out	Tue Jun 23 15:43:09 2009 -0500
@@ -297,6 +297,51 @@
 # hg stat
 M f
 
+# ui.merge specifies internal:prompt:
+[merge-tools]
+false.whatever=
+true.priority=1
+true.executable=cat
+# hg update -C 1
+# hg merge -r 2 --config ui.merge=internal:prompt
+0 files updated, 1 files merged, 0 files removed, 0 files unresolved
+(branch merge, don't forget to commit)
+# cat f
+revision 1
+space
+# hg stat
+M f
+
+# ui.merge specifies internal:dump:
+[merge-tools]
+false.whatever=
+true.priority=1
+true.executable=cat
+# hg update -C 1
+# hg merge -r 2 --config ui.merge=internal:dump
+merging f
+0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+use 'hg resolve' to retry unresolved file merges or 'hg up --clean' to abandon
+# cat f
+revision 1
+space
+# hg stat
+M f
+? f.base
+? f.local
+? f.orig
+? f.other
+
+f.base:
+revision 0
+space
+f.local:
+revision 1
+space
+f.other:
+revision 2
+space
+
 # ui.merge specifies internal:other but is overruled by pattern for false:
 [merge-tools]
 false.whatever=
--- a/tests/test-qrecord.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-qrecord.out	Tue Jun 23 15:43:09 2009 -0500
@@ -10,6 +10,7 @@
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
+ forget     forget the specified files on the next commit
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision
--- a/tests/test-strict.out	Mon Jun 22 15:58:22 2009 -0300
+++ b/tests/test-strict.out	Tue Jun 23 15:43:09 2009 -0500
@@ -11,6 +11,7 @@
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
+ forget     forget the specified files on the next commit
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision