Skip to content
Snippets Groups Projects
  1. Jul 05, 2014
    • Katsunori FUJIWARA's avatar
      filemerge: use 'basic' as the default of '[ui] mergemarkers' for safety · 10abc3a5
      Katsunori FUJIWARA authored
      Before this patch, 'detailed' is used as the default of '[ui]
      mergemarkers'. This embeds non-ASCII characters in tags, branches,
      bookmarks, author and/or commit descriptions into merged files in the
      encoding specified by '--encoding' global option, 'HGENCODING' or
      other locale setting environment variables.
      
      But, if files to be merged use another encoding, this behavior breaks
      consistency of encoding in merged files.
      
      For example, ISO-2022-JP or EUC-JP are sometimes used as the file
      encoding for Japanese characters, because of historical and/or
      environmental reasons, even though UTF-8 or Shift-JIS are ordinarily
      used as the terminal encoding.
      
      This can't be resolved automatically, because Mercurial doesn't aware
      encoding of managed files.
      
      This patch uses 'basic' as the default of '[ui] mergemarkers' to avoid
      embedding encoding sensitive characters for safety.
      
      This patch puts '[ui] mergemarkers = detailed' into default hgrc file
      for tests, to reduce changes for tests in this patch.
      10abc3a5
  2. Jul 18, 2014
    • Matt Harbison's avatar
      largefiles: avoid unnecessary creation of .hg/largefiles when opening lfdirstate · ac3b3a2d
      Matt Harbison authored
      Previously, the directory '.hg/largefiles' would always be created if it didn't
      exist when the lfdirstate was opened.  If there were no standin files, no
      dirstate file would be created in the directory.  The end result was that
      enabling the largefiles extension globally, but not explicitly adding a
      largefile would result in the repository eventually sprouting this directory.
      
      Creation of this directory effectively changes readonly operations like summary
      and status into operations that require write access.  Without write access,
      commands that would succeed without the extension loaded would abort with a
      surprising error when the extension is loaded, but not actively used:
      
        $ hg sum -R /tmp/thg --config extensions.largefiles=
        parent: 16541:00dc703d5aed
         repowidget: specify incoming bundle by plain file path to avoid url parsing
        branch: default
        abort: Permission denied: '/tmp/thg/.hg/largefiles'
      
      
      This change is simpler than changing the callers of openlfdirstate() to use the
      'create' parameter that was introduced in ae57920ac188, and probably how that
      should have been implemented in the first place.
      ac3b3a2d
  3. Nov 05, 2013
  4. Jul 15, 2014
  5. Jul 02, 2014
  6. Jul 07, 2014
  7. Jul 02, 2014
    • Pierre-Yves David's avatar
      push: add a ``pushop.stepsdone`` attribute · 8612c4ab
      Pierre-Yves David authored
      This attribute will record what steps were performed during the bundle2 push.
      This will control whenever the old way push must be performed or skipped. This
      will ultimately be used by changegroup, phases, obsmarkers, bookmarks and any
      other kind of data ones may want to exchange even when bundle2 support is
      missing.
      8612c4ab
    • Pierre-Yves David's avatar
      bundle2: add a ``bundle20.nbparts`` property · b8bd9708
      Pierre-Yves David authored
      This property can be used to know how much parts have been added to the bundle2.
      This will be useful to check if any part have been generated for a push.
      b8bd9708
    • Pierre-Yves David's avatar
      bundle2-push: extract changegroup logic in its own function · 52ab44b9
      Pierre-Yves David authored
      We extract the creation of changegroup related parts into its own function.
      This precludes the inclusion of more diverse data during the bundle2 push.
      
      We use a closure to carry the logic that need to be perform when processing the
      server reply.
      52ab44b9
    • Pierre-Yves David's avatar
      bundle2: call _pushbundle2extraparts a bit sooner · 10fcfb61
      Pierre-Yves David authored
      This is the first step of a refactoring that will ease the inclusion of new part
      in the bundle2 push and includes more information (like phases) in this push
      
      We need to move the function a bit sooner to be able to group the generation of
      `b2x:check:heads` and `b2x:changegroup` part in an external function. We move it
      sooner to preserve parts creation order bundle2 tests rely on. At the ends of this
      refactoring the `_pushbundle2extraparts` will be replaced by another mechanism
      anyway.
      10fcfb61
  8. Jul 15, 2014
    • Katsunori FUJIWARA's avatar
      templatekw: add 'subrepos' keyword to show updated subrepositories · 764adc33
      Katsunori FUJIWARA authored
      'subrepos' template keyword newly added by this patch shows updated
      subrepositories.
      
      For the compatibility with the list of subrepositories shown in the
      editor at commit:
      
        - 'subrepos' is empty, at revisions removing '.hgsub' itself
      
        - 'subrepos' is calculated between the revision and the first parent
          of it, at merge revisions
      
      To avoid silent regression, this patch also confirms "hg diff" of
      ".hgsubstate" and parents for each target revisions in the test.
      764adc33
    • Katsunori FUJIWARA's avatar
      templatekw: add 'currentbookmark' keyword to show current bookmark easily · 2b41ee1b
      Katsunori FUJIWARA authored
      Before this patch, complicated template expression below is required
      to show current active bookmark if it is associated with the
      changeset.
      
          "{bookmarks % '{ifeq(bookmark, current, \"{bookmark}\")}'}"
      
      This patch add 'currentbookmark' keyword to show current bookmark
      easily.
      2b41ee1b
  9. Jul 16, 2014
    • Siddharth Agarwal's avatar
      context: extend efficient manifest filtering to when all paths are files · 5809d62e
      Siddharth Agarwal authored
      On a repository with over 250,000 files and 700,000 commits, this improves
      cases like
      
      hg status --rev <rev> -- <file>  # rev is not .
      
      from 2.1 seconds to 1.4 seconds.
      
      There is further scope for improvement here: for a single file or a small set
      of files, it is probably more efficient to use filelog linkrevs when possible.
      However there will always be cases where that will fail (multiple commits
      pointing to the same file revision, removed files...), so this is independently
      useful.
      5809d62e
  10. Jul 12, 2014
  11. Jun 27, 2014
    • Angel Ezquerra's avatar
      tags: introduce _readtaghist function · 89cdebc3
      Angel Ezquerra authored
      The existing _readtags function has been modified a little and renamed
      _readtaghist. A new _readtaghist function has been added, which is a wrappger
      around _readtaghist. Its output is the same as the old _readtaghist.
      
      The purpose of this change is to make it possible to automatically merge tag
      files. In order to do so we will need to get the line numbers for each of the
      tag-node pairs on the first merge parent.
      
      This is not used yet, but will be used on a follow up patch that will introduce
      an automatic tag merge algorithm.
      
      I performed some tests to compare the effect of this change. I used timeit to
      run the test-tags.t test a 9 times with and without this patch. The results
      were:
      
      - without this patch: 3 loops, best of 3: 8.55 sec per loop
      - with this patch:    3 loops, best of 3: 8.49 sec per loop
      
      The the test was on average was slightly faster with this patch (although the
      difference was probably not statistically significant).
      89cdebc3
  12. Jun 19, 2014
    • Katsunori FUJIWARA's avatar
      subrepo: ensure "close()" execution at the end of "_initrepo()" · db8a27d9
      Katsunori FUJIWARA authored
      Before this patch, "close()" for the file object opened in
      "_initrepo()" may not be executed, if unexpected exception is raised,
      because it isn't executed in "finally" clause.
      
      This patch ensures "close()" execution at the end of "_initrepo()" by
      moving it into "finally" clause.
      
      This patch puts configuration lines into "lines" array and write them
      out at once, to narrow the scope of "try"/"finally" for review-ability.
      
      This patch doesn't use "vfs.write()", because:
      
        - current "vfs.write()" implementation doesn't take "mode" argument
          to open file in "text" mode
      
        - writing hgrc file out in binary mode may break backward compatibility
      db8a27d9
    • Katsunori FUJIWARA's avatar
      subrepo: add test whether "[paths]" is configured correctly at subrepo creation · 0f916db7
      Katsunori FUJIWARA authored
      This test is added for changes in the subsequent patch.
      
      This test doesn't use "(glob)" for expected output, because "[paths]"
      is configured at subrepo creation by "_abssource()" using
      "posixpath.join()" to join path components.
      0f916db7
    • Katsunori FUJIWARA's avatar
      subrepo: ensure "close()" execution at the end of "_cachestorehash()" · ee7e8dcf
      Katsunori FUJIWARA authored
      Before this patch, "close()" for the file object opened in
      "_cachestorehash()" may not be executed, if unexpected exception is
      raised, because it isn't executed in "finally" clause.
      
      This patch ensures "close()" execution at the end of
      "_cachestorehash()" by moving it into "finally" clause.
      ee7e8dcf
    • Katsunori FUJIWARA's avatar
      subrepo: ensure "close()" execution at the end of "_readstorehashcache()" · dfb8f757
      Katsunori FUJIWARA authored
      Before this patch, "close()" for the file object opened in
      "_readstorehashcache()" may not be executed, if unexpected exception
      is raised, because it isn't executed in "finally" clause.
      
      This patch ensures "close()" execution at the end of
      "_readstorehashcache()" by moving it into "finally" clause.
      dfb8f757
    • Katsunori FUJIWARA's avatar
      subrepo: ensure "close()" execution at the end of "_calcfilehash()" · 9aaffb22
      Katsunori FUJIWARA authored
      Before this patch, "close()" for the file object opened in
      "_calcfilehash()" may not be executed, if unexpected exception is
      raised, because it isn't executed in "finally" clause.
      
      This patch ensures "close()" execution at the end of "_calcfilehash()"
      by moving it into "finally" clause.
      9aaffb22
    • Katsunori FUJIWARA's avatar
      subrepo: ensure "lock.release()" execution at the end of "_cachestorehash()" · b9e8fdc3
      Katsunori FUJIWARA authored
      Before this patch, "lock.release()" for "self._repo" in
      "_cachestorehash()" of "hgsubrepo" may not be executed, if unexpected
      exception is raised, because it isn't executed in "finally" clause.
      
      This patch ensures "lock.release()" execution at the end of
      "_cachestorehash()" by moving it into "finally" clause.
      b9e8fdc3
    • Katsunori FUJIWARA's avatar
      subrepo: ensure "lock.release()" execution at the end of "storeclean()" · fe9db58b
      Katsunori FUJIWARA authored
      Before this patch, "lock.release()" for "self._repo" in "storeclean()"
      of "hgsubrepo" may not be executed, if unexpected exception is raised,
      because it isn't executed in "finally" clause.
      
      This patch ensures "lock.release()" execution at the end of
      "storeclean()" by moving it into "finally" clause.
      
      This patch chooses moving almost all lines in "storeclean()" into
      "_storeclean()" instead of indenting them for "try/finally" clauses,
      to keep diff simple for review-ability.
      fe9db58b
  13. Jul 07, 2014
    • Katsunori FUJIWARA's avatar
      largefiles: confirm existence of outgoing largefile entities in remote store · a858d3de
      Katsunori FUJIWARA authored
      Before this patch, "hg summary" and "hg outgoing" show and count up
      all largefiles changed/added in outgoing revisions, even though some
      of them are already uploaded into remote store.
      
      This patch confirms existence of outgoing largefile entities in remote
      store, to show and count up only really outgoing largefile entities at
      "hg summary" and "hg outgoing".
      a858d3de
    • Katsunori FUJIWARA's avatar
      largefiles: show also how many data entities are outgoing at "hg outgoing" · 87aa279f
      Katsunori FUJIWARA authored
      Before this patch, "hg outgoing --large" shows which largefiles are
      changed or added in outgoing revisions only in the point of the view
      of filenames.
      
      For example, according to the list of outgoing largefiles shown in "hg
      outgoing" output, users should expect that the former below costs much
      more to upload outgoing largefiles than the latter.
      
        - outgoing revisions add a hundred largefiles, but all of them refer
          the same data entity
      
          in this case, only one data entity is outgoing, even though "hg
          summary" says that a hundred largefiles are outgoing.
      
        - a hundred outgoing revisions change only one largefile with
          distinct data
      
          in this case, a hundred data entities are outgoing, even though
          "hg summary" says that only one largefile is outgoing.
      
      But the latter costs much more than the former, in fact.
      
      This patch shows also how many data entities are outgoing at "hg
      outgoing" by counting number of unique hash values for outgoing
      largefiles.
      
      When "--debug" is specified, this patch also shows what entities (in
      hash) are outgoing for each largefiles listed up, for debug purpose.
      
      In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
      list "toupload[fn]" always without duplication check, because
      de-duplication is already done in "_getoutgoings()".
      87aa279f
    • Katsunori FUJIWARA's avatar
      largefiles: show also how many data entities are outgoing at "hg summary" · 12019e6a
      Katsunori FUJIWARA authored
      Before this patch, "hg summary --large" shows how many largefiles are
      changed or added in outgoing revisions only in the point of the view
      of filenames.
      
      For example, according to the number of outgoing largefiles shown in
      "hg summary" output, users should expect that the former below costs
      much more to upload outgoing largefiles than the latter.
      
        - outgoing revisions add a hundred largefiles, but all of them refer
          the same data entity
      
          in this case, only one data entity is outgoing, even though "hg
          summary" says that a hundred largefiles are outgoing.
      
        - a hundred outgoing revisions change only one largefile with
          distinct data
      
          in this case, a hundred data entities are outgoing, even though
          "hg summary" says that only one largefile is outgoing.
      
      But the latter costs much more than the former, in fact.
      
      This patch shows also how many data entities are outgoing at "hg
      summary" by counting number of unique hash values for outgoing
      largefiles.
      
      This patch introduces "_getoutgoings" to centralize the logic
      (de-duplication, too) into it for convenience of subsequent patches,
      even though it is not required in "hg summary" case.
      12019e6a
    • Katsunori FUJIWARA's avatar
      largefiles: add tests for summary/outgoing improved in subsequent patches · 6f332778
      Katsunori FUJIWARA authored
      This patch adds tests for summary/outgoing improved in subsequent
      patches, to reduce amount of diffs in each patches.
      
      This patch adds new revisions below:
      
        - revision #2 adds new largefiles, but they contain as same data as
          one already existing
      
          this causes that multiple standins refer the same data entity
      
        - revision #3, #4 and #5 change the already existing largefile
      
          this causes that multiple data entities are outgoing for the standin.
          #5 can be used to check de-duplication of "(hash, filename)" pair.
      6f332778
  14. Jul 13, 2014
Loading