Skip to content
Snippets Groups Projects
  1. Apr 01, 2014
  2. Mar 08, 2014
  3. Mar 31, 2014
    • Katsunori FUJIWARA's avatar
      i18n: fix "% inside _()" problems · 9658a799
      Katsunori FUJIWARA authored
      Before this patch, "contrib/check-code.py" can't detect these
      problems, because the regexp pattern to detect "% inside _()" doesn't
      suppose the case that format string consists of multiple string
      components concatenated implicitly or explicitly,
      
      This patch does below for that regexp pattern to detect "% inside _()"
      problems in such case.
      
        - put "+" into separator part ("[ \t\n]") for explicit concatenation
          ("...." + "...." style)
      
        - enclose "component and separator" part by "(?:....)+" for
          concatenation itself ("...." "...." or "...." + "....")
      9658a799
    • Katsunori FUJIWARA's avatar
      i18n: fix "% inside _()" problems · 5db105f2
      Katsunori FUJIWARA authored
      Before this patch, "contrib/check-code.py" can't detect these
      problems, because the regexp pattern to detect "% inside _()" doesn't
      suppose the case that the format string and "%" aren't placed in the
      same line.
      
      This patch replaces "\s" in that regexp pattern with "[ \t\n]" to
      detect "% inside _()" problems in such case.
      
      "[\s\n]" can't be used in this purpose, because "\s" is automatically
      replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
      nested "[]" unexpectedly.
      5db105f2
    • Katsunori FUJIWARA's avatar
  4. Apr 01, 2014
  5. Mar 31, 2014
  6. Mar 28, 2014
    • Sean Farley's avatar
      tests: use TESTTMP instead of TESTDIR · e259d4c4
      Sean Farley authored
      In 57d0c8c3b947, f042d4b263f4, 1e686e55780c, and 5d22cadd1938, new tests were
      added that used TESTDIR instead of TESTTMP thereby leading to polluting the
      working directory with these temporary files. Now, we use TESTTMP so that they
      will be cleaned up properly.
      e259d4c4
    • Katsunori FUJIWARA's avatar
      hg: introduce "wirepeersetupfuncs" to setup wire peer by extensions (issue4109) · bc56ec9e
      Katsunori FUJIWARA authored
      Since changeset 6f72e7d28b35, "reposetup()" of each extensions is
      invoked only on repositories enabling corresponded extensions.
      
      This causes that largefiles specific interactions between the
      repository enabling largefiles locally and remote (wire) peer fail,
      because there is no way to know whether largefiles is enabled on the
      remote repository behind the wire peer, and largefiles specific
      "wireproto functions" are not given to any wire peers.
      
      To avoid this problem, largefiles should be enabled in wider scope
      than each repositories (e.g. user-wide "${HOME}/.hgrc").
      
      This patch introduces "wirepeersetupfuncs" to setup wire peer by
      extensions already enabled. Functions registered into
      "wirepeersetupfuncs" are invoked for all wire peers.
      
      This patch uses plain list instead of "util.hooks" for
      "wirepeersetupfuncs", because the former allows to control order of
      function invocation by order of extension enabling: it may be useful
      for workaround of problems with combination of enabled extensions
      bc56ec9e
  7. Mar 27, 2014
    • Sean Farley's avatar
      templater: raise error for unknown func · 6eb55310
      Sean Farley authored
      Previously, if a template '{foo()}' was given, the buildfunc would not be able
      to match it and hit a code path that would not return so it would error out
      later in the templater stating that NoneType was not iterable. This patch makes
      sure that a proper error is raised so that the user can be informed.
      
      Tests have been updated.
      6eb55310
  8. Mar 07, 2014
  9. Mar 25, 2014
  10. Mar 21, 2014
  11. Mar 18, 2014
  12. Mar 17, 2014
    • Jordi Gutiérrez Hermoso's avatar
      commit: propagate --secret option to subrepos (issue4182) · 03774a2b
      Jordi Gutiérrez Hermoso authored
      Before this patch, `hg commit --secret` was not getting propagated
      correctly, and subrepos were not getting the commit in the secret
      phase. The problem is that subrepos get their ui from the base repo's
      baseui object and ignore the ui object passed on to them. This sets
      and restores both ui objects with the appropriate option.
      03774a2b
  13. Mar 18, 2014
    • Katsunori FUJIWARA's avatar
      amend: save commit message into ".hg/last-message.txt" · 434619da
      Katsunori FUJIWARA authored
      Before this patch, commit message (may be manually edited) for "commit
      --amend" is never saved into ".hg/last-message.txt", because it uses
      "localrepository.commitctx()" instead of "localrepository.commit()":
      saving into ".hg/last-message.txt" is executed only in the latter.
      
      This patch saves commit message for "commit --amend" into
      ".hg/last-message.txt" just after user editing.
      
      This is the simplest implementation to fix on stable. Editing and
      saving commit message for memctx should be centralized into the
      framework like "localrepository.commit()" with "editor" argument or so
      in the future.
      434619da
    • Katsunori FUJIWARA's avatar
      histedit: save manually edited commit message into ".hg/last-message.txt" · 5d22cadd
      Katsunori FUJIWARA authored
      Before this patch, manually edited commit message for "fold" command
      in histedit-ing is never saved into ".hg/last-message.txt", because it
      uses "localrepository.commitctx()" instead of
      "localrepository.commit()": saving into ".hg/last-message.txt" is
      executed only in the latter.
      
      This patch saves manually edited commit message for "fold" command in
      histedit-ing into ".hg/last-message.txt" just after user editing.
      
      This is the simplest implementation to fix on stable. Editing and
      saving commit message for memctx should be centralized into the
      framework like "localrepository.commit()" with "editor" argument or so
      in the future.
      5d22cadd
    • Katsunori FUJIWARA's avatar
      qfold: save manually edited commit message into ".hg/last-message.txt" · 1e686e55
      Katsunori FUJIWARA authored
      Before this patch, manually edited commit message for "hg qfold -e"
      isn't saved into ".hg/last-message.txt" until it is saved by
      "localrepository.savecommitmessage()" in "localrepository.commit()".
      
      This may lose such commit message, if unexpected exception is raised.
      
      This patch saves manually edited commit message for "hg qfold -e" into
      ".hg/last-message.txt" just after user editing. This patch doesn't
      save the message specified by -m/-l options as same as other commands.
      
      This is the simplest implementation to fix on stable. Editing and
      saving commit message should be centralized into the framework of
      "localrepository.commit()" with "editor" argument in the future.
      
      This patch uses repository wrapping class for exception raising before
      saving commit message in "localrepository.commit()" easily and
      certainly, because such exception requires corner case condition.
      1e686e55
    • Katsunori FUJIWARA's avatar
      qnew: save manually edited commit message into ".hg/last-message.txt" · 57d0c8c3
      Katsunori FUJIWARA authored
      Before this patch, manually edited commit message for "hg qnew -e"
      isn't saved into ".hg/last-message.txt" until it is saved by
      "localrepository.savecommitmessage()" in "localrepository.commit()".
      
      This may lose such commit message, if unexpected exception is raised.
      
      This patch saves manually edited commit message for "hg qnew -e" into
      ".hg/last-message.txt" just after user editing. This patch doesn't
      save the message specified by -m/-l options as same as other commands.
      
      This is the simplest implementation to fix on stable. Editing and
      saving commit message should be centralized into the framework of
      "localrepository.commit()" with "editor" argument in the future.
      
      This patch uses repository wrapping class for exception raising before
      saving commit message in "localrepository.commit()" easily and
      certainly, because such exception requires corner case condition.
      57d0c8c3
    • Katsunori FUJIWARA's avatar
      tag: save manually edited commit message into ".hg/last-message.txt" · bcfc4f62
      Katsunori FUJIWARA authored
      Before this patch, manually edited commit message for "hg tag -e"
      isn't saved into ".hg/last-message.txt" until it is saved by
      "localrepository.savecommitmessage()" in "localrepository.commit()".
      
      This may lose such commit message, if unexpected exception is raised.
      
      This patch saves manually edited commit message for "hg tag -e" into
      ".hg/last-message.txt" just after user editing. This patch doesn't
      save the message specified by -m option (-l is not supported for "hg
      tag") as same as other commands.
      
      This is the simplest implementation to fix on stable. Editing and
      saving commit message should be centralized into the framework of
      "localrepository.commit()" with "editor" argument in the future.
      bcfc4f62
    • Katsunori FUJIWARA's avatar
      rebase: use "commitforceeditor" instead of "ui.edit()" for "--collapse" · 95aab23a
      Katsunori FUJIWARA authored
      Before this patch, "rebase --collapse --edit" without "--message" and
      "--logfile" invokes editor twice unexpectedly:
      
        1. explicit "ui.edit()" invocation in rebase extension itself
      
        2. indirect invocation in "localrepository.commit()" with "editor =
           commitforceeditor" assigned by "--edit" option
      
      This patch uses indirect "commitforceeditor" invocation instead of
      "ui.edit()" for "--collapse" without "--message" and "--logfile" to:
      
        - suppress redundant the former invocation
        - ensure editor invocation even when "--edit" is not specified
      95aab23a
    • Katsunori FUJIWARA's avatar
      localrepo: save manually edited commit message as soon as possible · f042d4b2
      Katsunori FUJIWARA authored
      Before this patch, "localrepository.commit()" invokes specified
      "editor" to edit commit message manually, and saves it after checking
      sub-repositories.
      
      This may lose manually edited commit message, if unexpected exception
      is raised while checking (or commiting recursively) sub-repositories.
      
      This patch saves manually edited commit message as soon as possible.
      f042d4b2
  14. Mar 13, 2014
    • Katsunori FUJIWARA's avatar
      commit: create new amend changeset as secret correctly for "--secret" option · b0153cb8
      Katsunori FUJIWARA authored
      Before this patch, "hg commit --amend --secret" doesn't create new
      amend changeset as secret, even though the internal function
      "commitfunc()" passed to "cmdutil.amend()" make "phases.new-commit"
      configuration as "secret" temporarily.
      
      "cmdutil.amend()" uses specified "commitfunc" only for temporary amend
      commit, and creates the final amend commit changeset by
      "localrepository.commitctx()" directly with memctx.
      
      This patch creates new amend changeset as secret correctly for
      "--secret" option, by changing "phases.new-commit" configuration
      temporarily before "localrepository.commitctx()".
      b0153cb8
  15. Mar 12, 2014
  16. Mar 09, 2014
    • Katsunori FUJIWARA's avatar
      templater: make strings in template expressions be "string-escape"-ed correctly · 5ab28a2e
      Katsunori FUJIWARA authored
      Changeset 64b4f0cd7336 (released with 2.8.1) fixed "recursively
      evaluate string literals as templates" problem (issue4102) by moving
      the location of "string-escape"-ing from "tokenizer()" to
      "compiletemplate()".
      
      But some parts in template expressions below are not processed by
      "compiletemplate()", and it may cause unexpected result.
      
        - 'expr' of 'if(expr, then, else)'
        - 'expr's of 'ifeq(expr, expr, then, else)'
        - 'sep' of 'join(list, sep)'
        - 'text' and 'style' of 'rstdoc(text, style)'
        - 'text' and 'chars' of 'strip(text, chars)'
        - 'pat' and 'repl' of 'sub(pat, repl, expr)'
      
      For example, '\n' of "{join(extras, '\n')}" is not "string-escape"-ed
      and treated as a literal '\n'. This breaks "Display the contents of
      the 'extra' field, one per line" example in "hg help templates".
      
      Just "string-escape"-ing on each parts above may not work correctly,
      because inside expression of nested ones already applies
      "string-escape" on string literals. For example:
      
        - "{join(files, '\n')}" doesn't return "string-escape"-ed string, but
        - "{join(files, if(branch, '\n', '\n'))}" does
      
      To fix this problem, this patch does:
      
        - introduce "rawstring" token and "runrawstring" method to handle
          strings not to be "string-escape"-ed correctly, and
      
        - make "runstring" method return "string-escape"-ed string, and
          delay "string-escape"-ing until evaluation
      
      This patch invokes "compiletemplate()" with "strtoken=exp[0]" in
      "gettemplate()", because "exp[1]" is not yet evaluated. This code path
      is tested via mapping ("expr % '{template}'").
      
      In the other hand, this patch invokes it with "strtoken='rawstring'"
      in "_evalifliteral()", because "t" is the result of "arg" evaluation
      and it should be "string-escape"-ed if "arg" is "string" expression.
      
      This patch doesn't test "string-escape"-ing on 'expr' of 'if(expr,
      then, else)', because it doesn't affect the result.
      5ab28a2e
    • Katsunori FUJIWARA's avatar
      templater: apply "stringify()" on sub expression to get string correctly · a54c0d83
      Katsunori FUJIWARA authored
      Templating syntax allows nested expression to be specified as parts
      below, but they are evaluated as a generator and don't work correctly.
      
        - 'sep' of 'join(list, sep)'
        - 'text' and 'chars' of 'strip(text, chars)'
      
      In the former case, 'sep' returns expected string only for the first
      separation, and empty one for the second or later, because the
      generator has only one element.
      
      In the latter case, templating is aborted by exception, because the
      generator doesn't have 'strip()' method (as 'text') and can't be
      passed as the argument to 'str.strip()' (as 'chars').
      
      This patch applies "stringify()" on these sub expression to get string
      correctly.
      a54c0d83
    • Katsunori FUJIWARA's avatar
      templater: avoid recursive evaluation of string literals completely · 7e627fe6
      Katsunori FUJIWARA authored
      Changeset 3d8bfe2ecf6d (released with 2.8.1) fixed "recursively
      evaluate string literals as templates" problem (issue4103) by
      introducing "_evalifliteral()".
      
      But some parts in template expressions below are still processed by
      the combination of "compiletemplate()" and "runtemplate()", and may
      cause same problem unexpectedly.
      
        - 'init' and 'hang' of 'fill(text, width, init, hang)'
        - 'expr' of 'sub(pat, repl, expr)'
        - 'label' of 'label(label, expr)'
      
      This patch processes them by "_evalifliteral()" instead of the
      combination of "compiletemplate()" and "runtemplate()" to avoid
      recursive evaluation of string literals completely.
      7e627fe6
  17. Mar 03, 2014
  18. Mar 01, 2014
  19. Feb 26, 2014
  20. Feb 27, 2014
    • Pierre-Yves David's avatar
      merge: infer the "other" changeset when falling back to v1 format · 303cbfe3
      Pierre-Yves David authored
      When we have to fallback to the old version of the file, we infer the
      "other" from current working directory parent. The same way it is currently done
      in the resolve command. This is know to have shortcoming… but we cannot do
      better from the data contained in the old file format. This is actually the
      motivation to add this new file format.
      303cbfe3
Loading