Skip to content
Snippets Groups Projects
  1. Oct 06, 2015
    • Pierre-Yves David's avatar
      extract: simplify parents assignement · 25a58881
      Pierre-Yves David authored
      We move to the more standard style of:
      
        value = default
        if special:
            value = other
      
      This is more consistent and compact.
      25a58881
    • Pierre-Yves David's avatar
      patch: move 'extract' return to a dictionnary · b9be8ab6
      Pierre-Yves David authored
      The final goal here is to be able to parse, return and process arbitrary data
      from patch. This mirror the recently added ability to add arbitrary data to
      patch headers.
      
      The first step is to return something more flexible, so we return a dict without
      changing any other logic.
      b9be8ab6
    • Pierre-Yves David's avatar
      patchbomb: add experimental config of a "pullurl" and export it · 500386e6
      Pierre-Yves David authored
      This config allows to specify a public location where your changeset can be
      found. It then include a dedicated patch header show a command to be used to
      retrieve the change. See the test for example.
      
      This is flagged as experimental because this feature is not safe until we have
      more logic to test that:
      - changeset actually exists on destination
      - changeset is draft on destination.
      
      As all this is experimental, bike shedding can happily happens before we remove
      the experimental flag.
      500386e6
    • Pierre-Yves David's avatar
      export: introduce a generic way to add patch header on export · e99c3846
      Pierre-Yves David authored
      Extensions currently have no easy way to add data to exported
      patch. This is now fixed using a generic mechanism in the same fashion
      used by bundle2. Tests are coming in the next changeset with its first
      user.
      e99c3846
  2. Oct 05, 2015
    • Pierre-Yves David's avatar
      incoming: request a bundle2 when possible (BC) · 1e8e0b01
      Pierre-Yves David authored
      Incoming was using bundle1 in all cases, as bundle1 is restricted to
      changegroup1 and does not support general delta, this can lead to significant
      CPU overhead if the server is using general delta storage. We now properly
      request and store a bundle2 to disk.
      
      If the server include any output or error in the bundle, they will be stored on
      disk and replayed when the bundle is read. As 'hg incoming' is going to read the
      bundle right away, we call that 'good' enough and go back to the bigger plan of
      having general delta on by default.
      
      This was tracked as 4864
      1e8e0b01
    • Pierre-Yves David's avatar
      bundlerepo: indent some code to prepare next patch · a018cbab
      Pierre-Yves David authored
      We are about to add a new condition. Code is indented in a separated patch for
      readability.
      a018cbab
  3. Oct 08, 2015
    • Pierre-Yves David's avatar
      bundle2: add a way to just forward the bundle2 stream to another user · b87e4638
      Pierre-Yves David authored
      There is use case for directly forward and bundle2 stream from the peer to a
      file (eg: 'hg incoming --bundle'), However ssh peers have no way to know the
      'getbundle' is over except for actually interpreting the bundle. So we need to
      have the unbundle do the interpreting and forward job.
      
      The function is marked as private to highlight that this is terrible and that we
      are sorry.
      b87e4638
  4. Oct 05, 2015
  5. Oct 07, 2015
  6. Oct 05, 2015
  7. Oct 02, 2015
  8. Oct 07, 2015
  9. Oct 08, 2015
  10. Oct 07, 2015
    • Siddharth Agarwal's avatar
      filemerge: switch trymerge boolean to mergetype enum · 7fa35604
      Siddharth Agarwal authored
      trymerge = False becomes mergetype = nomerge, and trymerge = True becomes
      mergetype = fullmerge or mergeonly, depending on whether a premerge happens.
      7fa35604
    • Siddharth Agarwal's avatar
      filemerge: add some merge types · abc2327e
      Siddharth Agarwal authored
      We're going to turn the 'trymerge' boolean into a 'mergetype' enum with these
      three possible values.
      abc2327e
    • Katsunori FUJIWARA's avatar
      shelve: restore unshelved dirstate explicitly after aborting transaction · 61c295d9
      Katsunori FUJIWARA authored
      Before this patch, "hg unshelve" uses aborting a current transaction
      to discard temporary changes while unshelving.
      
      This assumes that dirstate changes in a transaction scope are kept
      even after aborting it. But this assumption will be broken by
      "transactional dirstate". See the wiki page below for detail about it.
      
          https://mercurial.selenic.com/wiki/DirstateTransactionPlan
      
      This patch explicitly saves shelved dirstate just before aborting
      current transaction, and restore dirstate with it after aborting by
      utility function '_aborttransaction()' added by previous patch.
      61c295d9
    • Katsunori FUJIWARA's avatar
      shelve: restore shelved dirstate explicitly after aborting transaction · 1d23bf6c
      Katsunori FUJIWARA authored
      Before this patch, "hg shelve" uses aborting a current transaction to
      discard temporary changes while shelving.
      
      This assumes that dirstate changes in a transaction scope are kept
      even after aborting it. But this assumption will be broken by
      "transactional dirstate". See the wiki page below for detail about it.
      
          https://mercurial.selenic.com/wiki/DirstateTransactionPlan
      
      This patch explicitly saves shelved dirstate just before aborting
      current transaction, and restore dirstate with it after aborting by
      utility function '_aborttransaction()' added by previous patch.
      
      This patch replaces 'if tr: tr.abort()' by 'lockmod.release(tr)',
      because the former is already done in '_aborttransaction()' (and the
      latter has no effect), if current transaction is aborted in it
      successfully. Otherwise, the latter is enough to trigger aborting.
      1d23bf6c
    • Katsunori FUJIWARA's avatar
      shelve: add utility to abort current transaction but keep dirstate · 10f14bb2
      Katsunori FUJIWARA authored
      "hg shelve" and "hg unshelve" use aborting a current transaction to
      discard temporary changes while (un)shelving.
      
      This assumes that dirstate changes in a transaction scope are kept
      even after aborting it. But this assumption will be broken by
      "transactional dirstate". See the wiki page below for detail about it.
      
          https://mercurial.selenic.com/wiki/DirstateTransactionPlan
      
      This patch adds utility function "_aborttransaction()" to abort
      current transaction but keep dirstate changes for (un)shelving.
      
      'dirstate.invalidate()' just after aborting a transaction should be
      removed soon by subsequent patch, which writes or discards in-memory
      dirstate changes at releasing transaction according to the result of
      it.
      
      BTW, there are some other ways below, which (seem to, at first glance)
      resolve this issue. But this patch chose straightforward way for ease
      of review and future refactorring.
      
        - commit transaction at first, and then rollback it
      
          It causes unintentional "dirty read" of running transaction to
          other processes at committing it.
      
        - use dirstateguard to save and restore shelved dirstate
      
          After DirstateTransactionPlan, making 'dirstate.write()' write
          in-memory changes into actual file requires
          'transaction.writepending()' while transaction running.
      
          It causes meaningless writing other in-memory changes out, even
          though they are never referred.
      
          In addition to it, it isn't desirable that scope of dirstateguard
          and transaction intersects each other.
      
        - get list of files changed from the parent, keep it in memory, and
          emulate that changes after aborting transaction
      
          This additional memory consumption may block aborting transaction
          in large repository (on small resource environment).
      10f14bb2
    • Katsunori FUJIWARA's avatar
      dirstate: split write to write changes into files other than .hg/dirstate · 3f41e28a
      Katsunori FUJIWARA authored
      '_writedirstate()' is used mainly for "transactional dirstate". See
      the wiki page below for detail about it.
      
          https://mercurial.selenic.com/wiki/DirstateTransactionPlan
      3f41e28a
    • Katsunori FUJIWARA's avatar
      bookmarks: use recordchange instead of writing if transaction is active · 46dec89f
      Katsunori FUJIWARA authored
      Before this patch, 'bmstore.write()' always write in-memory bookmark
      changes into '.hg/bookmarks' regardless of transaction activity.
      
      If 'bmstore.write()' is invoked inside a transaction and it writes
      changes into '.hg/bookmarks', then:
      
        - original bookmarks aren't restored at failure of that transaction
      
          This breaks "all or nothing" policy of the transaction.
      
          BTW, "hg rollback" can restore bookmarks successfully even before
          this patch, because original bookmarks are saved into
          '.hg/journal.bookmarks' at the beginning of the transaction, and
          it (actually renamed as '.hg/undo.bookmarks') is used by "hg
          rollback".
      
        - uncommitted bookmark changes are visible to other processes
      
          This is a kind of "dirty read"
      
      For example, 'rebase.rebase()' implies 'bmstore.write()', and it may
      be executed inside the transaction of "hg unshelve". Then, intentional
      aborting at the end of "hg unshelve" transaction doesn't restore
      original bookmarks (this is obviously a bug).
      
      This patch uses 'bmstore.recordchange()' instead of actual writing by
      'bmstore._writerepo()', if any transaction is active
      
      This patch also removes meaningless restoring bmstore explicitly at
      the end of "hg shelve".
      
      This patch doesn't choose fixing each 'bmstore.write()' callers as
      like below, because writing similar code here and there is very
      redundant.
      
        before:
          bmstore.write()
      
        after:
          tr = repo.currenttransaction()
          if tr:
              bmstore.recordchange(tr)
          else:
              bmstore.write()
      
      Even though 'bmstore.write()' itself may have to be discarded by
      putting bookmark operations into transaction scope, this patch chose
      fixing it to implement "transactional dirstate" at first.
      46dec89f
    • Siddharth Agarwal's avatar
      filemerge: run symlink check for :merge3 · 48476c61
      Siddharth Agarwal authored
      Just like :merge, :merge3 doesn't support merging symlinks.
      48476c61
    • Siddharth Agarwal's avatar
      filemerge: print correct name of tool for symlink checks · a77679d0
      Siddharth Agarwal authored
      Earlier we'd print ':merge' even if the tool was something else like ':union'.
      That's clearly a bug.
      a77679d0
    • Siddharth Agarwal's avatar
      filemerge: normalize 'internal:foo' names to ':foo' · d8463a74
      Siddharth Agarwal authored
      In upcoming patches we're going to present these names in the UI -- it would be
      good not to present deprecated names.
      d8463a74
    • Siddharth Agarwal's avatar
      filemerge: use symlinkcheck for :merge and :union · eb9876aa
      Siddharth Agarwal authored
      This exposes a couple of bugs, both of which will be fixed in upcoming patches.
      eb9876aa
    • Siddharth Agarwal's avatar
      filemerge: add a precheck for symlinks · 0ffa7fe1
      Siddharth Agarwal authored
      This will be used by internal merge tools.
      0ffa7fe1
    • Siddharth Agarwal's avatar
      filemerge: call precheck if available · d5d8cd0e
      Siddharth Agarwal authored
      In upcoming patches we'll define a precheck function for some merge tools.
      d5d8cd0e
    • Siddharth Agarwal's avatar
      filemerge: add a before-merge callback to internal merge tools · 01224c28
      Siddharth Agarwal authored
      We're going to separate the pre-merge and merge steps for merge tools. The
      merge step will be specific to the tool, but the pre-merge step will be common
      to all merge tools that need it.
      
      However, some merge tools run checks *before* the pre-merge step. This callback
      will allow that to continue to work.
      01224c28
    • Siddharth Agarwal's avatar
      filemerge: indent filemerge.filemerge · 4c52dd40
      Siddharth Agarwal authored
      This will make upcoming patches much easier to review.
      4c52dd40
  11. Oct 02, 2015
Loading