Skip to content
Snippets Groups Projects
  1. Apr 11, 2015
  2. Apr 12, 2015
  3. Apr 11, 2015
    • Augie Fackler's avatar
      python3: update killdaemons and run-tests print and exception syntax · 0adc22a0
      Augie Fackler authored
      test-run-tests.t still passes fine on Python 2.6. run-tests.py --local
      no longer fails with syntax errors, and now fails looking for xrange.
      
      Most changes done with
      
      2to3 -w -f numliterals -f except -f print tests/run-tests.py tests/killdaemons.py
      
      after which one import was fixed in run-tests and a __future__ import
      was added.
      0adc22a0
  4. May 13, 2015
  5. May 06, 2015
    • Martin von Zweigbergk's avatar
      pathencode: for long paths, strip first 5 chars, not first dir · 297ea0df
      Martin von Zweigbergk authored
      When encoding long paths, the pure Python code strips the first
      directory from the path, while the native code currently strips the
      first 5 characters. This discrepancy has not been a problem so far,
      since we have not stored anything in directories other than
      data/. However, we will soon be storing submanifest revlogs in
      metadata/, so the discrepancy will have to go [1]. Since file
      collisions are avoided by the hashing alone (which is done on the full
      unencoded path), it doesn't really matter whether we drop the first
      dir, the first 5 characters, or special-case non-data/. To avoid
      touching the C code, let's always strip the first 5 characters.
      
       [1] Or maybe elsewhere, but the discrepancy is ugly either way.
      297ea0df
  6. May 13, 2015
  7. May 12, 2015
  8. Mar 30, 2015
  9. Apr 27, 2015
  10. May 13, 2015
  11. May 12, 2015
    • Pierre-Yves David's avatar
      commit: no longer allow empty commit with the 'force' argument (API) · 9a74b991
      Pierre-Yves David authored
      The new way to allow empty commit is to temporarily set the
      'ui.allowemptycommit' config option.
      
      
        allowemptyback = repo.ui.backupconfig('ui', 'allowemptycommit')
        try:
            repo.ui.setconfig('ui', 'allowemptycommit', True)
            repo.commit(...)
        finally:
            repo.ui.restoreconfig(allowemptyback)
      
      All known uses of force for allowing empty commits have been removed, so let's
      remove it from the allowemptycommits condition.
      9a74b991
    • Durham Goode's avatar
      import: use ui.allowemptycommit to allow empty commits · 74705570
      Durham Goode authored
      Previously import used force=partial to allow empty commits to be made. Let's
      switch it to using the new ui.allowemptycommit option. Tests says we can drop
      the 'force' argument in the processs.
      74705570
    • Durham Goode's avatar
      mq: use ui.allowemptycommit to allow empty commits · 672e0558
      Durham Goode authored
      Previously, mq used the force flag to allow empty commits. Now that we have
      ui.allowemptycommit let's switch to that instead. We can't completely remove the
      force flag since it is used for a bunch of other behavior in localrepo.commit.
      672e0558
  12. May 11, 2015
    • Durham Goode's avatar
      commit: add ui.allowemptycommit config option · 93e015a3
      Durham Goode authored
      This adds a config flag that enables a user to make empty commits.
      This is useful in a number of cases.
      
      For instance, automation that creates release branches via
      bookmarks may want to make empty commits to that release bookmark so that it
      can't be fast-forwarded and so it can record information about the release
      bookmark's creation. This is already possible with named branches, so making it
      possible for bookmarks makes sense.
      
      Another case we've wanted it is for mirroring repositories into Mercurial. We
      have automation that syncs commits into hg by running things from the command
      line. The ability to produce empty commits is useful for syncing unusual commits
      from other VCS's.
      
      In general, allowing the user to create the DAG as they see fit seems useful,
      and when I mentioned this in IRC more than one person piped up and said they
      were already hacking around this limitation by using mq, import, and
      commit-dummy-change-then-amend-the-content-away style solutions.
      93e015a3
    • Durham Goode's avatar
      commit: move empty commit condition to a new line · 4e857213
      Durham Goode authored
      The empty commit condition was a messy if condition. Let's move it to a new line
      and change it to 'or' statements so it's cleaner and more readable. A future
      commit will add additional logic to this line.
      4e857213
  13. May 08, 2015
    • Martin von Zweigbergk's avatar
      dirs: speed up by storing number of direct children per dir · 42e89b87
      Martin von Zweigbergk authored
      The Python version of the dirs type stores only the number of direct
      children associated with each directory. That means that while adding
      a directory, it only has to walk backwards until it runs into a
      directory that is already in its map. The C version walks all the way
      to the top-most directory. By copying the Python version's clever
      trick to the C code, we can speed it up quite a bit.
      
      On the Firefox repo, perfdirs now runs in 0.031390, from 0.056518
      before the undoing Sid's optimization in the previous change, and
      0.061835 before previous his optimization. More practically, it speeds
      up 'hg status nonexistent' on the Firefox repo from 0.176s to 0.155s.
      
      It's unclear why the C version did not have the same cleverness
      implemented from the start, especially given that they were both
      written by the same person (Bryan O'Sullivan) very close in time:
      
        856960173630 (scmutil: add a dirs class, 2013-04-10)
        02ee846b246a (scmutil: rewrite dirs in C, use if available, 2013-04-10)
      42e89b87
    • Martin von Zweigbergk's avatar
      dirs: back out forward-searching in finddirs() · b3a68fb8
      Martin von Zweigbergk authored
      This backs out the changes below. The next patch will implement a
      faster algorithm based on backward-walking in finddirs().
      
        67241ee427cf (dirs._addpath: reinstate use of Py_CLEAR, 2015-04-07)
        6f0e6fa9fdd7 (dirs._addpath: don't mutate Python strings after exposing them (issue4589), 2015-04-06)
        1a9efc312700 (dirs.addpath: rework algorithm to search forward, 2015-03-27)
      b3a68fb8
  14. Apr 15, 2015
    • Ryan McElroy's avatar
      templatekw: replace currentbookmark with activebookmark keyword · 7e5d5160
      Ryan McElroy authored
      Today, the terms 'active' and 'current' are interchangeably used throughout the
      codebase in reference to the active bookmark (the bookmark that will be updated
      with the next commit). This leads to confusion among developers and users.
      This patch is part of a series to standardize the usage to 'active' throughout
      the mercurial codebase and user interface.
      7e5d5160
    • Ryan McElroy's avatar
      templatekw: introduce activebookmark keyword · 277aba2c
      Ryan McElroy authored
      Today, the terms 'active' and 'current' are interchangeably used throughout the
      codebase in reference to the active bookmark (the bookmark that will be updated
      with the next commit). This leads to confusion among developers and users.
      This patch is part of a series to standardize the usage to 'active' throughout
      the mercurial codebase and user interface.
      277aba2c
    • Ryan McElroy's avatar
      templatekw: rename variable current to active · 256c8432
      Ryan McElroy authored
      Today, the terms 'active' and 'current' are interchangeably used throughout the
      codebase in reference to the active bookmark (the bookmark that will be updated
      with the next commit). This leads to confusion among developers and users.
      This patch is part of a series to standardize the usage to 'active' throughout
      the mercurial codebase and user interface.
      256c8432
  15. May 12, 2015
  16. May 09, 2015
    • Pierre-Yves David's avatar
      setup.py: drop compatibility with Python 2.4 and 2.5 (BC) · e1fb276d
      Pierre-Yves David authored
      The last blocker for dropping Python 2.4 was Centos 5. We now provide our own
      Mercurial package for Centos 5 with a bundled Python2.7.
      
      I'm therefore happy to officially drop compatibility with Python 2.4 (and
      Python 2.5 that nobody really cares about). This open the season for code
      cleanup.
      
      It is war's prize to take all vantage.
      e1fb276d
    • Pierre-Yves David's avatar
      rpm.spec: bump python dependency to 2.6 · 7940c538
      Pierre-Yves David authored
      We are about to drop 2.4 requirement in Mercurial's setup.py, we bump rpm
      dependency first for the sake of smaller changeset. Clean up of the spec file
      can come after the dependency is actually dropped.
      7940c538
  17. May 10, 2015
    • Jordi Gutiérrez Hermoso's avatar
      map-cmdline.bisect: rewrite to just %include the default template · 7c324f65
      Jordi Gutiérrez Hermoso authored
      This also adds labels to the output, as the tests now show.
      
      I took the liberty to give two labels to the bisection status, just
      like revisions get the log.changeset and changeset.phase statuses.
      7c324f65
    • Jordi Gutiérrez Hermoso's avatar
      log: add a status template · 517763f8
      Jordi Gutiérrez Hermoso authored
      It appears that git users like having a --name-status option on `git
      log`. There exist at least three questions on StackOverflow on how to
      do this for hg. The desired output is not difficult to build with
      templates, and since this is something that svn users might also want,
      it seems desirable to have this as another standard template.
      
      This mimics the output of `hg status` and adds it to the log output.
      It also follows status's convention of displaying copies with a -C
      option. Brief example:
      
          $ hg log -T status -C
          changeset:   24883:7d1b9b7ac9fd
          bookmark:    statustemplate
          tag:         tip
          parent:      24864:c560d8c68791
          user:        Jordi Gutiérrez Hermoso <jordigh@octave.org>
          date:        Wed Apr 22 14:05:04 2015 -0400
          summary:     log: add a status template
          files:
          A added
          A copied
            original
          M modified
          R removed
      
      Of course, everything is also coloured correctly, and there are tests
      to prove it.
      517763f8
  18. May 12, 2015
  19. May 02, 2015
  20. May 01, 2015
    • Yuya Nishihara's avatar
      templater: tokenize decimal integer literal (issue4638) (BC) · 829faf8a
      Yuya Nishihara authored
      Before this patch, we had to quote integer literals to pass to template
      functions. It was error-prone, so we should allow "word(0, x)" syntax.
      Currently only decimal integers are allowed. It's easy to support 0x, 0b and 0
      prefixes, but I don't think they are useful.
      
      This patch assumes that template keywords and names defined in map files do
      not start with digits, except for positional variables seen in the schemes
      extension.
      829faf8a
  21. May 02, 2015
  22. May 10, 2015
  23. May 07, 2015
    • Katsunori FUJIWARA's avatar
      rebase: use dirstateguard instead of dirstate.invalidate · c8a97fa7
      Katsunori FUJIWARA authored
      Before this patch, "rebase.concludenode()" uses "dirstate.invalidate()"
      as a kind of "restore .hg/dirstate to the original status" during a failure.
      
      But it just discards changes in memory, and doesn't actually restore
      ".hg/dirstate". Then, it can't work as expected, if "dirstate.write()"
      is executed while processing.
      
      This patch uses "dirstateguard" instead of "dirstate.invalidate()" to
      restore ".hg/dirstate" during a failure even if "dirstate.write()" is
      executed before a failure.
      
      This patch also removes "beginparentchage()" and "endparentchange()",
      because "dirstateguard" makes them useless.
      
      This is a part of preparations to fix the issue that the recent (in
      memory) dirstate isn't visible to external processes (e.g. "precommit"
      hook).
      
      After this patch, the changed dirstate becomes visible to external
      "precommit" hooks during "hg rebase" in "test-largefiles-misc.t",
      because "dirstateguard()" writes it out. But this content isn't yet
      correct, because:
      
        - "normal3" should be marked as "A"(dded) at committing
      
          It is newly added in the changeset being rebased.
      
        - but it is marked as "M"(odified)
      
          The result of "repo.setparents()" after "dirstateguard()" isn't
          yet written out before "precommit". So, merging is still in
          progress for "hg status" in it.
      
          This causes marking the file newly added on "other" branch as "A".
      
      This will be fixed by subsequent patch.
      c8a97fa7
    • Katsunori FUJIWARA's avatar
      mq: use dirstateguard instead of dirstate.invalidate (qrefresh) · 12f3c714
      Katsunori FUJIWARA authored
      Before this patch, "mq.queue.refresh()" uses "dirstate.invalidate()"
      as a kind of "restore .hg/dirstate to the original status" during a failure.
      
      But it just discards changes in memory, and doesn't actually restore
      ".hg/dirstate". Then, it can't work as expected, if "dirstate.write()"
      is executed while processing.
      
      This patch uses "dirstateguard" instead of "dirstate.invalidate()" to
      restore ".hg/dirstate" during a failure even if "dirstate.write()" is
      executed before a failure.
      
      This patch also removes "beginparentchage()" and "endparentchange()",
      because "dirstateguard" makes them useless.
      
      This is a part of preparations to fix the issue that the recent (in
      memory) dirstate isn't visible to external processes (e.g. "precommit"
      hook).
      12f3c714
    • Katsunori FUJIWARA's avatar
      mq: use dirstateguard instead of dirstate.invalidate (qpush) · 58308dde
      Katsunori FUJIWARA authored
      Before this patch, "mq.queue.apply()" uses "dirstate.invalidate()" as
      a kind of "restore .hg/dirstate to the original status" during afailure.
      
      But it just discards changes in memory, and doesn't actually restore
      ".hg/dirstate". Then, it can't work as expected, if "dirstate.write()"
      is executed while processing.
      
      This patch uses "dirstateguard" instead of "dirstate.invalidate()" to
      restore ".hg/dirstate" at failure even if "dirstate.write()" is
      executed before failure.
      
      This is a part of preparations to fix the issue that the recent (in
      memory) dirstate isn't visible to external processes (e.g. "precommit"
      hook).
      58308dde
    • Katsunori FUJIWARA's avatar
      tryimportone: use dirstateguard instead of beginparentchange/endparentchange · 0579b0c2
      Katsunori FUJIWARA authored
      To fix the issue that the recent (in memory) dirstate isn't visible to
      external process (e.g. "precommit" hook), a subsequent patch makes
      "localrepository.commit()" invoke "dirstate.write()" in it.
      
      This change will make "beginparentchange()" and "endparentchange()" on
      dirstate in "cmdutil.tryimportone()" meaningless, because:
      
        - "dirstate.write()" writes changed data into ".hg/dirstate", but
      
        - aborting between "beginparentchange()" and "endparentchange()"
          doesn't cause any restoring ".hg/dirstate"
      
          it just discards changes in memory.
      
      This patch uses "dirstateguard" instead of "beginparentchange()" and
      "endparentchange()" in "cmdutil.tryimportone()" to restore
      ".hg/dirstate" during a failure even if "dirstate.write()" is executed
      before a failure.
      
      This patch uses "lockmod.release(dsguard)" instead of
      "dsguard.release()", because processing may be aborted before
      assignment to "dsguard" , and the "if dsguard" examination for safety is
      redundant.
      0579b0c2
    • Katsunori FUJIWARA's avatar
      import: use dirstateguard instead of dirstate.invalidate · 713b09fc
      Katsunori FUJIWARA authored
      Before this patch, "commands.import()" uses "dirstate.invalidate()" as
      a kind of "restore .hg/dirstate to the original status" during a failure.
      
      But it just discards changes in memory, and doesn't actually restore
      ".hg/dirstate". Then, it can't work as expected, if "dirstate.write()"
      is executed while processing.
      
      This patch uses "dirstateguard" instead of "dirstate.invalidate()" to
      restore ".hg/dirstate" at failure even if "dirstate.write()" is
      executed before failure.
      
      This patch also removes "beginparentchage()" and "endparentchange()",
      because "dirstateguard" makes them useless, too.
      
      This is a part of preparations to fix the issue that the recent (in
      memory) dirstate isn't visible to external process (e.g. "precommit"
      hook).
      713b09fc
Loading