Skip to content
Snippets Groups Projects
  1. Oct 07, 2015
    • Siddharth Agarwal's avatar
      filemerge: switch trymerge boolean to mergetype enum · 7fa3560443fd
      Siddharth Agarwal authored
      trymerge = False becomes mergetype = nomerge, and trymerge = True becomes
      mergetype = fullmerge or mergeonly, depending on whether a premerge happens.
      7fa3560443fd
    • Siddharth Agarwal's avatar
      filemerge: add some merge types · abc2327e382a
      Siddharth Agarwal authored
      We're going to turn the 'trymerge' boolean into a 'mergetype' enum with these
      three possible values.
      abc2327e382a
    • Katsunori FUJIWARA's avatar
      shelve: restore unshelved dirstate explicitly after aborting transaction · 61c295d9d402
      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.
      61c295d9d402
    • Katsunori FUJIWARA's avatar
      shelve: restore shelved dirstate explicitly after aborting transaction · 1d23bf6cd90a
      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.
      1d23bf6cd90a
    • Katsunori FUJIWARA's avatar
      shelve: add utility to abort current transaction but keep dirstate · 10f14bb22950
      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).
      10f14bb22950
    • Katsunori FUJIWARA's avatar
      dirstate: split write to write changes into files other than .hg/dirstate · 3f41e28a16d8
      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
      3f41e28a16d8
    • Katsunori FUJIWARA's avatar
      bookmarks: use recordchange instead of writing if transaction is active · 46dec89fe888
      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.
      46dec89fe888
    • Siddharth Agarwal's avatar
      filemerge: run symlink check for :merge3 · 48476c6129a2
      Siddharth Agarwal authored
      Just like :merge, :merge3 doesn't support merging symlinks.
      48476c6129a2
    • Siddharth Agarwal's avatar
      filemerge: print correct name of tool for symlink checks · a77679d0b887
      Siddharth Agarwal authored
      Earlier we'd print ':merge' even if the tool was something else like ':union'.
      That's clearly a bug.
      a77679d0b887
    • Siddharth Agarwal's avatar
      filemerge: normalize 'internal:foo' names to ':foo' · d8463a743d7d
      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.
      d8463a743d7d
    • Siddharth Agarwal's avatar
      filemerge: use symlinkcheck for :merge and :union · eb9876aa8770
      Siddharth Agarwal authored
      This exposes a couple of bugs, both of which will be fixed in upcoming patches.
      eb9876aa8770
    • Siddharth Agarwal's avatar
      filemerge: add a precheck for symlinks · 0ffa7fe1076b
      Siddharth Agarwal authored
      This will be used by internal merge tools.
      0ffa7fe1076b
    • Siddharth Agarwal's avatar
      filemerge: call precheck if available · d5d8cd0e0d58
      Siddharth Agarwal authored
      In upcoming patches we'll define a precheck function for some merge tools.
      d5d8cd0e0d58
    • Siddharth Agarwal's avatar
      filemerge: add a before-merge callback to internal merge tools · 01224c28e0ed
      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.
      01224c28e0ed
    • Siddharth Agarwal's avatar
      filemerge: indent filemerge.filemerge · 4c52dd406adc
      Siddharth Agarwal authored
      This will make upcoming patches much easier to review.
      4c52dd406adc
  2. Oct 02, 2015
  3. Oct 01, 2015
  4. Sep 30, 2015
  5. Oct 07, 2015
  6. Oct 05, 2015
  7. Oct 02, 2015
  8. Oct 01, 2015
  9. Oct 06, 2015
  10. Oct 04, 2015
    • Yuya Nishihara's avatar
      util: use tuple accessor to get accurate st_mtime value (issue4836) · 13272104bb07
      Yuya Nishihara authored
      Because st.st_mtime is computed as 'sec + 1e-9 * nsec' and double is too narrow
      to represent nanoseconds, int(st.st_mtime) can be 'sec + 1'. Therefore, that
      value could be different from the one got by osutils.listdir().
      
      This patch fixes the problem by accessing to raw st_mtime by tuple index.
      
      It catches TypeError to fall back to st.st_mtime because our osutil.stat does
      not support tuple index. In dirstate.normal(), 'st' is always a Python stat,
      but in dirstate.status(), it can be either a Python stat or an osutil.stat.
      
      Thanks to vgatien-baron@janestreet.com for finding the root cause of this
      subtle problem.
      13272104bb07
    • Yuya Nishihara's avatar
      util: extract stub function to get mtime with second accuracy · 3a0bb61371c5
      Yuya Nishihara authored
      This function is trivial but will need a long comment why it can't use
      st.st_mtime. See the next patch for details.
      3a0bb61371c5
  11. Oct 05, 2015
  12. Sep 24, 2015
Loading