Skip to content
Snippets Groups Projects
  1. Aug 03, 2017
  2. Aug 02, 2017
    • Pulkit Goyal's avatar
      morestatus: move fb extension to core by plugging to `hg status --verbose` · 96f43981
      Pulkit Goyal authored
      morestatus extension in fbext use to show more context about the state of the
      repo like the repository is in a unfinished merge state, or a rebase is going
      on, or histedit is going on, listing the files which need to be resolved and
      also suggesting ways to handle the situation.
      
      This patch moves the extension directly to core by plugging it into the
      --verbose flag of the status command. So now if you are in any unfinished state
      and you do hg status -v, it will show you details and help related to the state.
      
      The extension in fbext also shows context about unfinished update state
      which is not ported to core as that plug in hooks to update command which need
      to be tackled somewhat differently.
      
      The following configuration will turn the behaviour on by default
      
      [commands]
      status.verbose = 1
      
      You can also skip considering some states like bisect as follows:
      
      [commands]
      status.skipstates=bisect
      
      This patch also adds test for the feature.
      
      .. feature::
      
         ``hg status -v`` can now show unfinished state. For example, when in
         an unfinished rebase state, ``hg status -v`` might show::
      
         # The repository is in an unfinished *rebase* state.
         # No unresolved merge conflicts.
         # To continue:                hg rebase --continue
         # To abort:                   hg rebase --abort
      
      Differential Revision: https://phab.mercurial-scm.org/D219
      96f43981
  3. Aug 09, 2017
  4. Aug 10, 2017
    • Jun Wu's avatar
      fsmonitor: correct an error message · dd35abc4
      Jun Wu authored
      Without the change, the error looks like:
      
        warning: Watchman unavailable: "watchman" executable not in PATH (%s),
        while executing [Errno 2] No such file or directory
      
      With the change, it now looks like:
      
        warning: Watchman unavailable: "watchman" executable not in PATH
        ([Errno 2] No such file or directory)
      
      Differential Revision: https://phab.mercurial-scm.org/D322
      dd35abc4
  5. Aug 11, 2017
    • Gregory Szorc's avatar
      sshpeer: make instance attributes and methods internal · 82d564d5
      Gregory Szorc authored
      Peer types are supposed to conform to a formal interface defined by
      peer.peerrepository and wireproto.wirepeer. Every "public" attribute on
      *peer types makes it harder to understand what attributes are part
      of the interface and what are instance specific.
      
      This commit converts a number of "public" instance attributes and
      methods on sshpeer to internal so they can't be confused to be part of
      the peer API.
      
      The URL-related instance attributes were introduced in 876333a295ff
      in 2005. AFAICT most of them aren't used and could potentially be
      removed. But I kept them around anyway.
      
      I also reorded some code to make things slightly easier to read.
      
      .. api::
      
         Rename attributes on sshpeer to reflect peer API
      
      Differential Revision: https://phab.mercurial-scm.org/D331
      82d564d5
  6. Aug 10, 2017
    • Gregory Szorc's avatar
      peer: remove non iterating batcher (API) · b47fe973
      Gregory Szorc authored
      The last use of this API was removed in b6e71f8af5b8 in 2016. While
      not formally deprecated, as of the last commit the code is no longer
      explicitly tested. I think the new API has existed long enough for
      people to transition to it.
      
      I also have plans to more formalize the peer API and removing batch()
      makes that work easier.
      
      I'm not convinced the current client-side API around batching is
      great. But it's the best we have at the moment.
      
      .. api:: remove peer.batch()
      
         Replace with peer.iterbatch().
      
      Differential Revision: https://phab.mercurial-scm.org/D320
      b47fe973
    • Gregory Szorc's avatar
      wireproto: overhaul iterating batcher code (API) · 4c706037
      Gregory Szorc authored
      The remote batching code is difficult to read. Let's improve it.
      
      As part of the refactor, the future returned by method calls on
      batchiter() instances is now populated. However, you still need to
      consume the results() generator for the future to be set.  But at
      least now we can stuff the future somewhere and not have to worry
      about aligning method call order with result order since you can
      use a future to hold the result.
      
      Also as part of the change, we now verify that @batchable generators
      yield exactly 2 values. In other words, we enforce their API.
      
      The non-iter batcher has been unused since b6e71f8af5b8. And to my
      surprise we had no explicit unit test coverage of it! test-batching.py
      has been overhauled to use the iterating batcher.
      
      Since the iterating batcher doesn't allow non-batchable method
      calls nor local calls, tests have been updated to reflect reality.
      The iterating batcher has been used for multiple releases apparently
      without major issue. So this shouldn't cause alarm.
      
      .. api::
      
         @peer.batchable functions must now yield exactly 2 values
      
      Differential Revision: https://phab.mercurial-scm.org/D319
      4c706037
    • Gregory Szorc's avatar
      wireproto: remove support for local results in @batchable (API) · e2fc2122
      Gregory Szorc authored
      @peer.batchable decorated generator functions have two forms:
      
          yield value, None
      
      and
      
          yield args, future
          yield value
      
      These forms have been present since the decorator was introduced.
      
      There are currently no in-repo consumers of the first form. So this
      commit removes support for it.
      
      Note that remoteiterbatcher.submit() asserts the 2nd form. And
      b6e71f8af5b8 removed the last user of remotebatcher, forcing everyone
      to remoteiterbatcher. So anything relying on this in the wild would
      have been broken since b6e71f8af5b8.
      
      .. api::
      
         @peer.batchable can no longer emit local values
      
      Differential Revision: https://phab.mercurial-scm.org/D318
      e2fc2122
    • Gregory Szorc's avatar
      wireproto: properly implement batchable checking · 297d1b70
      Gregory Szorc authored
      remoteiterbatcher (unlike remotebatcher) only supports batchable
      commands. This claim can be validated by comparing their
      implementations of submit() and noting how remoteiterbatcher assumes
      the invoked method has a "batchable" attribute, which is set by
      @peer.batchable.
      
      remoteiterbatcher has a custom __getitem__ that was trying to
      validate that only batchable methods are called. However, it was only
      validating that the called method exists, not that it is batchable.
      
      This wasn't a big deal since remoteiterbatcher.submit() would raise
      an AttributeError attempting to `mtd.batchable(...)`.
      
      Let's fix the check and convert it to ProgrammingError, which may
      not have been around when this was originally implemented.
      
      Differential Revision: https://phab.mercurial-scm.org/D317
      297d1b70
    • Gregory Szorc's avatar
      largefiles: remove remotestore.batch() · dcdc1755
      Gregory Szorc authored
      This method was added in 9e1616307c4c. AFAICT it didn't do anything at
      inception. If it did, there was no test coverage for it because
      changing it to raise doesn't fail any tests at that revision.
      
      b6e71f8af5b8 later refactored all remote.batch() calls to
      remote.iterbatch(). So if this was somehow used, it isn't called
      any more because there are no calls to .batch() remaining in the
      repo.
      
      I suspect the original patch author got confused by the distinction
      between the peer/remote interface and the largefiles store. The lf
      store is a gateway to a peer instance. It exposes additional
      lf-specific methods to execute against a peer. However, it is not
      a peer and doesn't need to implement batch() because peer itself
      does that.
      
      Differential Revision: https://phab.mercurial-scm.org/D316
      dcdc1755
  7. Aug 11, 2017
  8. Jul 31, 2017
  9. May 21, 2017
  10. Jul 31, 2017
  11. Jun 30, 2017
  12. Aug 10, 2017
  13. Aug 07, 2017
  14. Aug 05, 2017
  15. Jul 31, 2017
    • Sean Farley's avatar
      subrepo: add tests for git rogue ssh urls (SEC) · db83a1df
      Sean Farley authored
      'ssh://' has an exploit that will pass the url blindly to the ssh
      command, allowing a malicious person to have a subrepo with
      '-oProxyCommand' which could run arbitrary code on a user's machine. In
      addition, at least on Windows, a pipe '|' is able to execute arbitrary
      commands.
      
      When this happens, let's throw a big abort into the user's face so that
      they can inspect what's going on.
      db83a1df
    • Sean Farley's avatar
      subrepo: add tests for svn rogue ssh urls (SEC) · 60ee7af2
      Sean Farley authored
      'ssh://' has an exploit that will pass the url blindly to the ssh
      command, allowing a malicious person to have a subrepo with
      '-oProxyCommand' which could run arbitrary code on a user's machine. In
      addition, at least on Windows, a pipe '|' is able to execute arbitrary
      commands.
      
      When this happens, let's throw a big abort into the user's face so that
      they can inspect what's going on.
      60ee7af2
    • Sean Farley's avatar
      subrepo: add tests for hg rogue ssh urls (SEC) · 475af2f8
      Sean Farley authored
      'ssh://' has an exploit that will pass the url blindly to the ssh
      command, allowing a malicious person to have a subrepo with
      '-oProxyCommand' which could run arbitrary code on a user's machine. In
      addition, at least on Windows, a pipe '|' is able to execute arbitrary
      commands.
      
      When this happens, let's throw a big abort into the user's face so that
      they can inspect what's going on.
      475af2f8
    • Sean Farley's avatar
      push: add tests for unsafe ssh url (SEC) · 48d520fd
      Sean Farley authored
      48d520fd
  16. Jul 28, 2017
Loading