Skip to content
Snippets Groups Projects
  1. Jun 28, 2017
  2. Jun 26, 2017
  3. Jun 29, 2017
  4. Jun 26, 2017
    • Gregory Szorc's avatar
      show: config option to register aliases for views · 99ce2f58
      Gregory Szorc authored
      As part of using `hg show` in my daily workflow, I've found it slightly
      annoying to have to type full view names, complete with a space. I've
      locally registered an alias for "swork = show work."
      
      I think others will have this same complaint and could benefit from
      some automation to streamline the creation of aliases. So, this
      commit introduces a config option that allows `hg show` views to be
      automatically aliased using a given prefix. e.g. a value of "s"
      will automatically register "swork" and "sbookmarks." Multiple
      values can be given for ultimate flexibility. This arguably isn't
      needed now. But since we don't register aliases if there will be
      a collision and we're bound to have a collision, it makes sense to
      allow multiple prefixes so specific views can avoid collisions by
      using different prefixes.
      99ce2f58
  5. Jun 18, 2017
  6. Jun 17, 2017
  7. Jun 27, 2017
    • Pierre-Yves David's avatar
      rebase: backed out changeset cf8ad0e6c0e4 (issue5610) · a5abaa81
      Pierre-Yves David authored
      Having a single transaction for rebase means the whole transaction gets rolled back
      on error. To work around this a small hack has been added to detect merge
      conflict and commit the work done so far before exiting. This hack works because
      there is nothing transaction related going on during the merge phase.
      
      However, if a hook blocks the rebase to create a changeset, it is too late to commit the
      work done in the transaction before the problematic changeset was created. This
      leads to the whole rebase so far being rolled back. Losing merge resolution and
      other work in the process. (note: rebase state will be fully lost too).
      
      Since issue5610 is a pretty serious regression and the next stable release is a
      couple day away, we are taking the backout route until we can figure out
      something better to do.
      a5abaa81
    • Pierre-Yves David's avatar
      rebase: backed out changeset 2519994d25ca · b63351f6
      Pierre-Yves David authored
      In the process of fixing issue5610 in 4.2.2, we are trying to backout
      cf8ad0e6c0e4. This changeset is making changes that depend on cf8ad0e6c0e4,
      so we need to back it out first.
      
      Since issue5610 is pretty serious regression and the next stable release is a
      couple of days away, we are taking the backout route until we can figure out
      something better to do.
      b63351f6
  8. Jun 25, 2017
    • Katsunori FUJIWARA's avatar
      keyword: wrap functions only once at loading keyword extension · 279c072a
      Katsunori FUJIWARA authored
      Before this patch, some functions are wrapped in reposetup(), but this
      causes redundant nested wrapping, if two ore more repositories enable
      keyword extension (e.g. hgweb serves multiple repositories).
      
      Now, there is no need to define these wrapper functions in
      reposetup(), because previous patches made them not directly refer to
      kwtemplater instanciated in reposetup().
      
      This patch factors these wrapper functions out from reposetup(), and
      uses them to wrap functions only at once at loading keyword extension.
      279c072a
    • Katsunori FUJIWARA's avatar
      keyword: use _keywordkwt of repository instead of kwtools['templater'] · 735218be
      Katsunori FUJIWARA authored
      Now, kwtemplater instance can be obtained via _keywordkwt property of
      repository.
      735218be
    • Katsunori FUJIWARA's avatar
      keyword: obtain kwtemplater instance via repository at runtime · ed92a496
      Katsunori FUJIWARA authored
      Wrapper functions of keyword extension are defined in reposetup(),
      because they refer to kwtemplater instantiated in reposetup().
      
      This patch makes them obtain kwtemplater instance via repository at
      runtime. For reviewability, this patch focuses on wrapper functions,
      which handle generator.
      
      This is a part of preparations for defining them statically.
      ed92a496
    • Katsunori FUJIWARA's avatar
      keyword: obtain kwtemplater instance via repository at runtime · a15da610
      Katsunori FUJIWARA authored
      Wrapper functions of keyword extension are defined in reposetup(),
      because they refer to kwtemplater instantiated in reposetup().
      
      This patch makes them obtain kwtemplater instance via repository at
      runtime.
      
      This is a part of preparations for defining them statically.
      a15da610
    • Katsunori FUJIWARA's avatar
      keyword: make wrapped repository and kwtemplater refer to each other · 5a51db8b
      Katsunori FUJIWARA authored
      Wrapper functions of keyword extension are defined in reposetup(),
      because they refer to kwtemplater instantiated in reposetup().
      
      But these functions can be defined statically, if kwtemplater can be
      obtained via repository at runtime.
      
      This is a part of preparations for defining them statically.
      
      To avoid cyclic reference, this patch makes kwtemplater use weakref to
      refer related repository instance.
      5a51db8b
    • Katsunori FUJIWARA's avatar
      keyword: make comparison webcommand suppress keyword expansion · 0afdc1a4
      Katsunori FUJIWARA authored
      Before this patch, diff in "comparison" webcommand doesn't suppress
      keyword expansion as same as diff output of other webcommands.
      0afdc1a4
    • Katsunori FUJIWARA's avatar
      keyword: restore kwtemplater.match at the end of wrapped webcommands · 9062458f
      Katsunori FUJIWARA authored
      Before this patch, kwweb_skip doesn't restore kwtemplater.match after
      wrapped webcommands. This suppresses keyword expansion at wrapped
      webcommands.
      
      Typical usecase of this issue is "file" webcommand after annotate,
      changeset, filediff or so on.
      
      To ensure kwtemplater.match=util.never while original webcommand
      running, this patch makes kwweb_skip yield values returned by it,
      because it returns generator object.
      9062458f
    • Katsunori FUJIWARA's avatar
      keyword: restore kwtemplater.restrict at the end of wrapped patch.diff · 7f569ce3
      Katsunori FUJIWARA authored
      Before this patch, kwdiff doesn't restore kwtemplater.restrict after
      invocation of wrapped patch.diff(). This suppresses keyword expansion
      at subsequent filelog.read().
      
      Typical usecase of this issue is "hg cat" after "hg diff" with command
      server. In this case, kwtemplater.restrict=True is kept in command
      server process even after "hg diff".
      
      To ensure kwtemplater.restrict=True while original patch.diff()
      running, this patch makes kwdiff() yield values returned by it,
      because it returns generator object.
      
      Strictly speaking, if filelog.read() is invoked before completely
      evaluating the result of previous patch.diff(), keyword expansion is
      still suppressed, because kwtemplater.restrict isn't restored yet.
      
      But this fixing should be reasonable enough, because patch.diff() is
      consumed immediately, AFAIK.
      7f569ce3
    • Jun Wu's avatar
      rebase: clean up rebasestate from active transaction · 2312e70c
      Jun Wu authored
      Previously, rebase assumes the following pattern:
      
          rebase:
              with transaction as tr: # top-level
                  ...
              tr.__close__ writes rebasestate
              unlink('rebasestate')
      
      However it's possible that "rebase" was called inside a transaction:
      
          with transaction as tr1:
              rebase:
                  with transaction as tr2: # not top-level
                      ...
                  tr2.__close__ does not write rebasestate
                  unlink('rebasestate')
          tr1.__close__ writes rebasestate
      
      That leaves a rebasestate on disk incorrectly.
      
      This patch adds "removefilegenerator" to notify transaction code that the
      state file is no longer needed therefore fixes the issue.
      2312e70c
  9. Jun 24, 2017
    • Gregory Szorc's avatar
      show: construct changeset templater during dispatch · 11f76825
      Gregory Szorc authored
      Previously, we constructed a formatter from a specific template
      topic. Then from show() we reached into the internals of the
      formatter to resolve a template string to be used to construct
      a changeset templater.
      
      A downside to this approach was it limited us to having the
      entire template defined in a single entry in the map file. You
      couldn't reference other entries in the map file and this would
      lead to long templates and redundancy in the map file.
      
      This commit teaches @showview how to instantiate a changeset
      templater so we can construct a templater with full access to
      the map file. To prove it works, we've split "showwork" into
      components.
      11f76825
  10. Jun 22, 2017
  11. Jun 16, 2017
    • Martin von Zweigbergk's avatar
      bundle: add a applybundle1() method · b82615af
      Martin von Zweigbergk authored
      This is one step towards removing a bunch of "if isinstance(gen,
      unbundle20)" by treating bundle1 and bundle2 more similarly.
      
      The name may sounds ironic for a method in the bundle2 module, but I
      didn't think it was worth it yet to create a new 'bundle' module that
      depends on the 'bundle2' module. Besides, we'll inline the method
      again later.
      b82615af
  12. Jun 24, 2017
  13. Jun 21, 2017
  14. Jun 23, 2017
    • Katsunori FUJIWARA's avatar
      fetch: remove shorthand of --edit colliding against -e/-ssh in remoteopts (BC) · 9c242e9f
      Katsunori FUJIWARA authored
      Before this patch, -e/--edit and -e/--ssh of fetch command collide
      against each other. This causes that -e is treated as shorthand of
      --edit but doesn't work as same as --edit. Therefore, -e works as
      neither --edit nor --ssh, in practice.
      
      This issue was introduced at 595a69a01129 (or 1.0), which renamed
      -f/--force-editor to -e/--edit. At that point, -e was already used as
      shorthand of --ssh.
      
      After this patch, -e is treated as shorthand of --ssh.
      
      This patch is marked as "(BC)", because -e as shorthand of --edit in
      existing scripts causes failure (or unexpected result) after this
      patch. This impact should be less enough, because --edit mainly
      focuses on interactive use.
      
      BTW, test-duplicateoptions.py (since 7d171c05a631 or 1.9) can't detect
      this kind of issues as expected, because direct invocation of
      extensions.loadall() doesn't involve registration of commands defined
      in extensions (this issue is fixed in subsequent patch).
      9c242e9f
    • Rishabh Madan's avatar
      releasenotes: improve parsing around bullet points · 5814db57
      Rishabh Madan authored
      Earlier, on parsing the bullet points from existing release notes the bullet
      points after the first one weren't written correctly to the notes file. This
      patch makes changes to parsereleasenotesfromfile() function that introduces a new
      bullet_points data structure that tracks the bullets and associated subparagraph.
      It also makes necessary changes to the tests related to merging of bullets.
      5814db57
    • Pierre-Yves David's avatar
      eol: fix 'error' parameter name in the commitctx wrapper · 4e7352b8
      Pierre-Yves David authored
      Since its introduction in 9dfee83c93c8, the parameter has always been name
      "error". Yet the eol extension have been using 'haserror' as the argument name,
      breaking extensions with subclass passing 'error' as a keyword argument.
      4e7352b8
    • Pierre-Yves David's avatar
      eol: import 'error' as 'errormod' · 74930cf4
      Pierre-Yves David authored
      We need the 'error' name available to fix another bug, so we rename the imported
      module.
      74930cf4
  15. Jun 21, 2017
    • Jun Wu's avatar
      shelve: allow unlimited shelved changes per name · 4107eb8a
      Jun Wu authored
      Previously, there is a 100 changes limit per name (bookmark or named
      branch). And the user will get "too many shelved changes named %s" when they
      are trying to shelve the 101th change. I hit that error message today.
      
      This limit was introduced by the shelve extension since the beginning.
      The function generating the names was called "gennames", under
      "getshelvename".
      
      There is another "gennames" under "backupfilename":
      
          def backupfilename(self):
              def gennames(base):
                  yield base
                  base, ext = base.rsplit('.', 1)
                  for i in itertools.count(1):
                      yield '%s-%d.%s' % (base, i, ext)
      
      "itertools.count" is an endless counter.
      
      Since the other "gennames" generates unlimited number of names, and the
      changeset introducing the limit (49d4919d21c2) does not say why the limit
      is useful. It seems safe to just remove the limit.
      
      The format "%02d" was kept intentionally so existing shelved changes won't
      break.
      4107eb8a
  16. Jun 20, 2017
  17. Jun 16, 2017
  18. Jun 19, 2017
  19. Jun 18, 2017
  20. Jun 17, 2017
  21. Jun 16, 2017
Loading