Skip to content
Snippets Groups Projects
  1. Dec 07, 2015
  2. Nov 13, 2015
  3. Nov 30, 2015
  4. Dec 08, 2015
    • Katsunori FUJIWARA's avatar
      commit: make commit acquire store lock before processing for consistency · a18328aa
      Katsunori FUJIWARA authored
      If acquisition of wlock waits for another "hg commit" process to
      release it, dirstate will refer newly committed revision after
      acquisition of wlock.
      
      At that time, '00changelog.i' on the filesystem contains this new
      revision, but in-memory 'repo.changelog' doesn't, if it is cached
      without store lock (slock) before updating by another "hg commit".
      
      This makes validating parents at re-loading 'repo.dirstate' from
      '.hg/dirstate' replace such new revision with 'nullid'. Then,
      'localrepository.commit()' creates "orphan" revision (see issue4368
      for detail).
      
      a01d3d32b53a makes 'commands.commit()' acquire both wlock and slock
      before processing to avoid this issue at "hg commit".
      
      But similar issue can occur even after a01d3d32b53a, if 3rd party
      extension does:
      
        - refer 'repo.changelog' outside wlock scope, and
        - invoke 'repo.commit()' directly (instead of 'commands.commit()')
      
      This patch makes 'commit()' acquire slock before processing, to refer
      recent changelog at validating parents of 'repo.dirstate'.
      a18328aa
    • Katsunori FUJIWARA's avatar
      censor: make censor acquire locks before processing · 525d9b3f
      Katsunori FUJIWARA authored
      Before this patch, "hg censor" executes below:
      
        - without acquisition of wlock, examine whether the working
          directory refers the revision of the file to be censored or not
      
        - without acquisition of store lock (slock), replace existing
          filelog of file to be censored with censored one,
      
          Replacement consists of steps below, and it is assumed that the
          destination filelog at (1) isn't changed before renaming at (3).
      
          1. read existing filelog in
          2. write filelog entries (both censored and not) into temporary file
          3. rename from temporary file to existing filelog to be censored
      
      It may cause unintentional result, if another command runs parallelly
      (see also issue4368).
      
      This patch makes "hg censor" acquire wlock and slock before
      processing.
      525d9b3f
    • Katsunori FUJIWARA's avatar
      transplant: widen wlock scope of transplant for consitency while processing · ee33e677
      Katsunori FUJIWARA authored
      Before this patch, "hg transplant" executes below before acquisition
      of wlock.
      
        - cmdutil.checkunfinished()
        - repo.status() for dirty check
        - repo.dirstate.parents()
      
      It may cause unintentional result, if another command runs parallelly
      (see also issue4368).
      
      This patch makes "hg transplant" acquire wlock before processing
      instead of acquiring wlock in each of 'transplanter.apply()' and
      'transplanter.recover()'.
      ee33e677
    • Katsunori FUJIWARA's avatar
      shelve: remove redundant acquisition of wlock for sub commands of unshelve · c14af2d4
      Katsunori FUJIWARA authored
      Previous patch ensures that wlock is acquired before processing for
      "hg unshelve". It makes acquisition of wlock in each functions below
      redundant.
      
        - unshelveabort() for "unshelve --abort"
        - unshelvecontinue() for "unshelve --continue"
      c14af2d4
    • Katsunori FUJIWARA's avatar
      shelve: widen wlock scope of unshelve for consistency while processing · c9ceea3f
      Katsunori FUJIWARA authored
      Before this patch, "hg unshelve" of shelve extension executes below
      before acquisition of wlock:
      
        - cmdutil.checkunfinished()
        - examine existence of (specified) shelve file
      
      It may cause unintentional result, if another command runs parallelly
      (see also issue4368).
      
      This patch widens wlock scope of "hg unshelve" of shelve extension for
      consistency while processing.
      c9ceea3f
  5. Dec 07, 2015
  6. Dec 08, 2015
  7. Dec 06, 2015
    • Pierre-Yves David's avatar
      localrepo: reinstate localrepo.parents with a deprecation warning · 07ae7e8c
      Pierre-Yves David authored
      The function was dropped in 3fe8cb40c9c5. This API drop brokes three of my
      extensions including some critical to my workflow like tortoisehg. Lets mark
      this API for death and give people time to fix their code.
      07ae7e8c
    • Pierre-Yves David's avatar
      bookmark: deprecate 'bmstore.write' method · 38024b75
      Pierre-Yves David authored
      This function does not collaborate with the transaction and must disappear. As
      we have likely a lot of third party users, we make it deprecated to let them some
      time to upgrade their code.
      
      Thanks goes to Laurent Charignon for cleanup the last remains of the 'write'
      method.
      38024b75
    • Pierre-Yves David's avatar
      ui: add a 'deprecwarn' helper to issue deprecation warnings · f2cd240f
      Pierre-Yves David authored
      As discussed on the list, we are adding an official way to keep old API around
      for a short time in order to help third party developer to catch up. The
      deprecated API will issue developer warning (issued by default during test runs)
      to warn extensions authors that they need to upgrade their code without
      instantaneously breaking tool chains and normal users.
      
      The version is passed as an explicit argument so that developer think about it
      and a potential future script can automatically check for it.
      
      This is not build as a decorator because accessing the 'ui' instance will likely
      be different each time. The message is also free form because deprecated API are
      replaced in a variety of ways. I'm not super happy about the final rendering of
      that message, but this is a developer oriented warning and I would like to move
      forward.
      f2cd240f
    • Pierre-Yves David's avatar
      ui: add a 'stacklevel' argument to 'develwarn' · 82910fdc
      Pierre-Yves David authored
      This allows helper functions (like deprecation warning) to prepare a devel
      warning for higher up in the stack. The argument is named after the one in the
      Python's 'warning,warn' function.
      82910fdc
    • Yuya Nishihara's avatar
      import-checker: tell which symbol causes "direct symbol import" · 5d5b9834
      Yuya Nishihara authored
      This would be sometimes useful to understand why import-checker.py complains
      about it.
      5d5b9834
    • Yuya Nishihara's avatar
      import-checker: allow absolute imports of sub modules from local packages · 69308357
      Yuya Nishihara authored
      Before this patch, import-checker.py didn't know if a name in ImportFrom
      statement are module or not. Therefore, it complained the following example
      did "direct symbol import from mercurial".
      
        # hgext/foo.py
        from mercurial import hg
      
      This patch reuses the dict of local modules to filter out sub-module names.
      69308357
  8. Dec 04, 2015
    • Martin von Zweigbergk's avatar
      manifest: use 't' for tree manifest flag · 2a31433a
      Martin von Zweigbergk authored
      We currently use 'd' to indicate that a manifest entry is a
      directory. Let's switch to 't', since that's not a valid hex digit and
      therefore easier to spot in the raw manifest data.
      
      This will break any existing repos with tree manifests, but it's still
      an experimental feature and there are probably only a few test repos
      in existence with 'd' flags.
      2a31433a
  9. Dec 06, 2015
  10. Dec 04, 2015
    • Gregory Szorc's avatar
      setup.py: attempt to build and install hg.exe on Windows · ed1660ce
      Gregory Szorc authored
      Currently, packaging Mercurial on Windows will produce a
      Scripts\hg Python script and a Scripts\hg.bat batch script. The
      py2exe distribution contains a hg.exe which loads a Python
      interpretter and invokes the "hg" Python script. Running a
      exe directly has benefits over batch scripts because batch
      scripts do things like muck around with command arguments.
      
      This patch implements a custom "build_scripts" command which
      attempts to build hg.exe on Windows. If hg.exe is built, it is
      marked as a "script" file and installed into the Scripts\
      directory on Windows. Since hg.exe is redundant and better than
      hg.bat, if hg.exe is built, hg.bat is not installed.
      
      Since some environments don't support compiling C programs,
      we treat hg.exe as optional and catch failures building it. This
      is not ideal. However, I reckon most Windows users will not be
      installing Mercurial from source: they will get it from the MSI
      installer or via `pip install Mercurial`, which will download a
      wheel that has hg.exe in it. So, I don't think this is a big deal.
      ed1660ce
    • Andrew Halberstadt's avatar
      merge.graft: add option to keep second parent · d6859d86
      Andrew Halberstadt authored
      Currently merge.graft re-writes the dirstate so only a single
      parent is kept. For some cases, like evolving a merge commit,
      this behaviour is not desired. More specifically, this is
      needed to fix issue4389.
      d6859d86
  11. Dec 06, 2015
    • Gregory Szorc's avatar
      ui: support declaring path push urls as sub-options · 4dccc37b
      Gregory Szorc authored
      Power users often want to apply per-path configuration options. For
      example, they may want to declare an alternate URL for push operations
      or declare a revset of revisions to push when `hg push` is used
      (as opposed to attempting to push all revisions by default).
      
      This patch establishes the use of sub-options (config options with
      ":" in the name) to declare additional behavior for paths.
      
      New sub-options are declared by using the new ``@ui.pathsuboption``
      decorator. This decorator serves multiple purposes:
      
      * Declaring which sub-options are registered
      * Declaring how a sub-option maps to an attribute on ``path``
        instances (this is needed to `hg paths` can render sub-options
        and values properly)
      * Validation and normalization of config options to attribute
        values
      * Allows extensions to declare new sub-options without monkeypatching
      * Allows extensions to overwrite built-in behavior for sub-option
        handling
      
      As convenient as the new option registration decorator is, extensions
      (and even core functionality) may still need an additional hook point
      to perform finalization of path instances. For example, they may wish
      to validate that multiple options/attributes aren't conflicting with
      each other. This hook point could be added later, if needed.
      
      To prove this new functionality works, we implement the "pushurl"
      path sub-option. This option declares the URL that `hg push` should
      use by default.
      
      We require that "pushurl" is an actual URL. This requirement might be
      controversial and could be dropped if there is opposition. However,
      objectors should read the complicated code in ui.path.__init__ and
      commands.push for resolving non-URL values before making a judgement.
      
      We also don't allow #fragment in the URLs. I intend to introduce a
      ":pushrev" (or similar) option to define a revset to control which
      revisions are pushed when "-r <rev>" isn't passed into `hg push`.
      This is much more powerful than #fragment and I don't think #fragment
      is useful enough to continue supporting.
      
      The [paths] section of the "config" help page has been updated
      significantly. `hg paths` has been taught to display path sub-options.
      
      The docs mention that "default-push" is now deprecated. However, there
      are several references to it that need to be cleaned up. A large part
      of this is converting more consumers to the new paths API. This will
      happen naturally as more path sub-options are added and more and more
      components need to access them.
      4dccc37b
    • Gregory Szorc's avatar
      ui: pass ui instance to path.__init__ · 47539ea0
      Gregory Szorc authored
      It will be used in a subsequent patch.
      47539ea0
    • Gregory Szorc's avatar
      ui: store pushloc as separate attribute · e07003a9
      Gregory Szorc authored
      The magic @property is going to interfere with the ability to print
      path sub-options. We only access it in one location and it is trivial
      to in-line, so do that.
      e07003a9
    • Gregory Szorc's avatar
      commands: add debugdeltachain command · 4efb36ec
      Gregory Szorc authored
      We have debug commands for displaying overall revlog statistics
      (debugrevlog) and for dumping a revlog index (debugindex). As part
      of investigating various aspects of revlog behavior and performance,
      I found it important to have an understanding of how revlog
      delta chains behave in practice.
      
      This patch implements a "debugdeltachain" command. For each revision
      in a revlog, it dumps information about the delta chain. Which delta
      chain it is part of, length of the delta chain, distance since base
      revision, info about base revision, size of the delta chain, etc. The
      generic formatting facility is used, which means we can templatize
      output and get machine readable output like JSON.
      
      This command has already uncovered some weird history in
      mozilla-central I didn't know about. So I think it's valuable.
      4efb36ec
  12. Oct 24, 2015
    • Gregory Szorc's avatar
      histedit: pick an appropriate base changeset by default (BC) · 3d0feb2f
      Gregory Szorc authored
      Previously, `hg histedit` required a revision argument specifying which
      revision to use as the base for the current histedit operation. There
      was an undocumented and experimental "histedit.defaultrev" option that
      supported defining a single revision to be used if no argument is
      passed.
      
      Mercurial knows what changesets can be edited. And in most scenarios,
      people want to edit this history of everything on the current head that
      is rewritable. Making histedit do this by default and not require
      an explicit argument or additional configuration is a major usability
      win and will enable more people to use histedit.
      
      This patch changes the behavior of the experimental and undocumented
      "histedit.defaultrev" config option to select an appropriate base
      revision by default. Comprehensive tests exercising the edge cases
      in the new, somewhat complicated default revset have been added.
      Surprisingly, no tests broke. I guess we were never testing the
      behavior with no ANCESTOR argument (it used to fail with
      "abort: histedit requires exactly one ancestor revision"). The new
      behavior is much more user friendly.
      
      The functionality for choosing the default base revision has been
      moved to destutil.py, where it can easily be modified by extensions.
      3d0feb2f
  13. Dec 05, 2015
Loading