Skip to content
Snippets Groups Projects
  1. Apr 17, 2015
  2. Apr 16, 2015
  3. Apr 12, 2015
    • Matt Harbison's avatar
      match: add a subclass for dirstate normalizing of the matched patterns · baa11dde
      Matt Harbison authored
      This class is only needed on case insensitive filesystems, and only
      for wdir context matches. It allows the user to not match the case of
      the items in the filesystem- especially for naming directories, which
      dirstate doesn't handle[1]. Making dirstate handle mismatched
      directory cases is too expensive[2].
      
      Since dirstate doesn't apply to committed csets, this is only created by
      overriding basectx.match() in workingctx, and only on icasefs.  The default
      arguments have been dropped, because the ctx must be passed to the matcher in
      order to function.
      
      For operations that can apply to both wdir and some other context, this ends up
      normalizing the filename to the case as it exists in the filesystem, and using
      that case for the lookup in the other context.  See the diff example in the
      test.
      
      Previously, given a directory with an inexact case:
      
        - add worked as expected
      
        - diff, forget and status would silently ignore the request
      
        - files would exit with 1
      
        - commit, revert and remove would fail (even when the commands leading up to
          them worked):
      
              $ hg ci -m "AbCDef" capsdir1/capsdir
              abort: CapsDir1/CapsDir: no match under directory!
      
              $ hg revert -r '.^' capsdir1/capsdir
              capsdir1\capsdir: no such file in rev 64dae27060b7
      
              $ hg remove capsdir1/capsdir
              not removing capsdir1\capsdir: no tracked files
              [1]
      
      Globs are normalized, so that the -I and -X don't need to be specified with a
      case match.  Without that, the second last remove (with -X) removes the files,
      leaving nothing for the last remove.  However, specifying the files as
      'glob:**.Txt' does not work.  Perhaps this requires 're.IGNORECASE'?
      
      There are only a handful of places that create matchers directly, instead of
      being routed through the context.match() method.  Some may benefit from changing
      over to using ctx.match() as a factory function:
      
        revset.checkstatus()
        revset.contains()
        revset.filelog()
        revset._matchfiles()
        localrepository._loadfilter()
        ignore.ignore()
        fileset.subrepo()
        filemerge._picktool()
        overrides.addlargefiles()
        lfcommands.lfconvert()
        kwtemplate.__init__()
        eolfile.__init__()
        eolfile.checkrev()
        acl.buildmatch()
      
      Currently, a toplevel subrepo can be named with an inexact case.  However, the
      path auditor gets in the way of naming _anything_ in the subrepo if the top
      level case doesn't match.  That is trickier to handle, because there's the user
      provided case, the case in the filesystem, and the case stored in .hgsub.  This
      can be fixed next cycle.
      
        --- a/tests/test-subrepo-deep-nested-change.t
        +++ b/tests/test-subrepo-deep-nested-change.t
        @@ -170,8 +170,15 @@
           R sub1/sub2/test.txt
           $ hg update -Cq
           $ touch sub1/sub2/folder/bar
        +#if icasefs
        +  $ hg addremove Sub1/sub2
        +  abort: path 'Sub1\sub2' is inside nested repo 'Sub1'
        +  [255]
        +  $ hg -q addremove sub1/sub2
        +#else
           $ hg addremove sub1/sub2
           adding sub1/sub2/folder/bar (glob)
        +#endif
           $ hg status -S
           A sub1/sub2/folder/bar
           ? foo/bar/abc
      
      The narrowmatcher class may need to be tweaked when that is fixed.
      
      
      [1] http://www.selenic.com/pipermail/mercurial-devel/2015-April/068183.html
      [2] http://www.selenic.com/pipermail/mercurial-devel/2015-April/068191.html
      baa11dde
    • Matt Harbison's avatar
      match: move _normalize() into the match class · 0b1577c8
      Matt Harbison authored
      This will be overridden in an upcoming patch to also deal with dirstate
      normalization on case insensitive filesystems.
      0b1577c8
  4. Jan 17, 2015
    • Mads Kiilerich's avatar
      largefiles: always consider updatelfiles 'checked' parameter set · b8c3a099
      Mads Kiilerich authored
      mergeupdate already set the flag to update all. This will thus only change
      overriderevert and scmutilmarktouched ... where the flag effectually also were
      true. The test coverage thus shows no change.
      
      As the flag always is set, it is removed.
      
      This is mainly a change for keeping the code simple and consistent and correct,
      but it should also make it faster in many cases.
      b8c3a099
  5. Apr 15, 2015
    • Mads Kiilerich's avatar
      largefiles: for update -C, only update largefiles when necessary · 9d5c2789
      Mads Kiilerich authored
      Before, a --clean update with largefiles would use the "optimization" that it
      didn't read hashes from standin files before and after the update. Instead of
      trusting the content of the standin files, it would rehash all the actual
      largefiles that lfdirstate reported clean and update the standins that didn't
      have the expected content. It could thus in some "impossible" situations
      automatically recover from some "largefile got out sync with its standin"
      issues (even there apparently still were weird corner cases where it could
      fail). This extra checking is similar to what core --clean intentionally do
      not do, and it made update --clean unbearable slow.
      
      Usually in core Mercurial, --clean will rely on the dirstate to find the files
      it should update. (It is thus intentionally possible (when trying to trick the
      system or if there should be bugs) to end up in situations where --clean not
      will restore the working directory content correctly.) Checking every file when
      we "know" it is ok is however not an option - that would be too slow.
      
      Instead, trust the content of the standin files. Use the same logic for --clean
      as for linear updates and trust the dirstate and that our "logic" will keep
      them in sync. It is much cheaper to just rehash the largefiles reported dirty
      by a status walk and read all standins than to hash largefiles.
      
      Most of the changes are just a change of indentation now when the different
      kinds of updates no longer are handled that differently. Standins for added
      files are however only written when doing a normal update, while deleted and
      removed files only will be updated for --clean updates.
      9d5c2789
    • Matt Harbison's avatar
      subrepo: calculate _relpath for hgsubrepo based on self instead of parent · 56e15db9
      Matt Harbison authored
      Prior to 105758d1b37b, the subrelpath() (now _relpath) for hgsubrepo was
      calculated by removing the root path of the outermost repo from the root path of
      the subrepo.  Since the root paths use platform specific separators, and the
      relative path is printed by various commands, the output of these commands
      require a glob (and check-code.py enforces this).
      
      In an effort to be generic to all subrepos, 105758d1b37b started calculating
      this path based on the parent repo, and then joining the subrepo path in .hgsub.
      One of the tests in test-subrepo.t creates a subrepo inside a directory, so the
      path being joined contained '/' instead of '\'.  This made the test fail with a
      '~' status, because the glob is unnecessary[1].  Removing them made the test
      work, but then check-code complains.  We can't just drop the check-code rule,
      because sub-subrepos are still joined with '\'.  Presumably the other subrepo
      types have this issue as well, but there likely isn't a test with git or svn
      repos inside a subdirectory.
      
      This simply restores the exact _relpath value (and output) for hgsubrepos prior
      to 105758d1b37b.
      
      
      [1] http://www.selenic.com/pipermail/mercurial-devel/2015-April/068720.html
      56e15db9
    • Matt Harbison's avatar
      subrepo: backout 93b0e0db7929 to restore reporelpath() · 39f519be
      Matt Harbison authored
      The path for hgsubrepo needs to be calculated slightly differently from other
      subrepo types, but can reuse this.  See the next patch for details.
      39f519be
  6. Apr 16, 2015
    • Matt Mackall's avatar
      rollback: clear resolve state (issue4593) · 59406b8b
      Matt Mackall authored
      59406b8b
    • Durham Goode's avatar
      diff: pass the diff matcher to the copy logic · a7f8e358
      Durham Goode authored
      This passes the existing diff matcher instance down to the copy logic so copy
      tracing can be more efficient when possible and only trace copies for matching
      files.
      
      This only actually affects forwardcopies (i.e. Given A<-B<-C<-D, it works for
      'hg diff -r B -r D foo.txt', but not for 'hg diff -r D -r B foo.txt') since
      backward copies require walking all histories, and not just the individual
      file's.
      
      This reduces 'hg diff -r A -r B foo.txt' time from 15s to 1s when A and B have
      80,000 files different.
      a7f8e358
    • Durham Goode's avatar
      copies: add matcher parameter to copy logic · 4906dc0e
      Durham Goode authored
      This allows passing a matcher down the pathcopies() stack to _forwardcopies().
      This will let us add logic in a later patch to avoid tracing copies when not
      necessary (like when doing hg diff -r 1 -r 2 foo.txt).
      4906dc0e
  7. Apr 13, 2015
    • Martin von Zweigbergk's avatar
      treemanifest: extract parse method from constructor · 055b3cbe
      Martin von Zweigbergk authored
      When we start to lazily load submanifests, it will be useful to be
      able to create an treemanifest instance before manifest data gets
      parsed into it. To prepare for this, extract the parsing code from
      treemanifest's constructor to a separate method.
      055b3cbe
  8. Apr 12, 2015
    • Martin von Zweigbergk's avatar
      manifest: duplicate call to addrevision() · 4ea521b3
      Martin von Zweigbergk authored
      When we start writing submanifests to their own revlogs, we will not
      want to write a new revision for a directory if there were no changes
      to it. To prepare for this, duplicate the call to addrevision() and
      move them earlier where they can more easily be avoided.
      4ea521b3
  9. Apr 16, 2015
    • Laurent Charignon's avatar
      record: add message when starting record's curses interface · 23727465
      Laurent Charignon authored
      We are adding this log message to reduce a confusion when a command prints
      something just before starting the curses interface.
      
      Since the interactive mode is taking over the entire screen, starts with no
      delay and does wait for a key press, the user believes that messages printed
      before opening the interactive mode were actually printed after using
      interactive mode, not before.
      The fix adds the line "Starting interactive mode" helping the user separate
      the messages that were printed before and after the start of the
      interactive mode.
      
      One particular example where this was a problem is the revert command where we
      first print the list of changes to be considered for revert, then opens the
      curses interface right away without letting the user see the messages.
      The user then selects the changes, validates and then see the messages from
      before opening the interactive mode and is confused.
      23727465
  10. Apr 14, 2015
  11. Apr 12, 2015
  12. Apr 16, 2015
  13. Apr 04, 2015
    • Durham Goode's avatar
      histedit: delete all non-actionclass related code · a9d63d87
      Durham Goode authored
      Now that all actions have been migrated to the class format, we can delete all
      the unnecessary code that supported the old function format.
      a9d63d87
    • Durham Goode's avatar
      histedit: improve roll action integration with fold · 090da033
      Durham Goode authored
      Previously the fold action would inspect it's class to figure out if it was a
      rollup or not. This was hacky. Now that finishfold is inside the fold class,
      let's modify it to check a function (which roll can override) to determine if it
      should be prompting for a commit message.
      090da033
    • Durham Goode's avatar
      histedit: move finishfold into fold class · 8f6494eb
      Durham Goode authored
      Let's move the finishfold function into the fold class so we can modify it from
      the roll class more easily.
      8f6494eb
    • Durham Goode's avatar
      histedit: convert fold/roll actions into a class · 3133e246
      Durham Goode authored
      This converts the fold/roll actions into a histeditclass instance, as part of an
      ongoing effort to refactor histedit for maintainability and robustness.
      
      The tests changed for two reasons:
      
      1) We get a new 'empty changeset' warning because we now warn more consistently
      between normal histedit and --continue about commits disappearing.
      
      2) Previously we were not putting the histedit-source extra field on the
      temporary fold commit during normal runs, but we were on --continue runs. By
      unifying these code paths we now consistently put histedit-source on the
      temporary fold commit, which changes some of the hashes in the backup bundles.
      3133e246
    • Durham Goode's avatar
      histedit: convert edit action into a class · facdb20e
      Durham Goode authored
      This converts the edit action into a histeditclass instance, as part of an
      ongoing effort to refactor histedit for maintainability and robustness.
      facdb20e
    • Durham Goode's avatar
      histedit: convert message action into a class · e875b94d
      Durham Goode authored
      This converts the message action into a histeditclass instance, as part of an
      ongoing effort to refactor histedit for maintainability and robustness.
      e875b94d
    • Durham Goode's avatar
      histedit: convert drop action into a class · 34267170
      Durham Goode authored
      This converts the drop action into a histeditclass instance, as part of an
      ongoing effort to refactor histedit for maintainability and robustness.
      34267170
    • Durham Goode's avatar
      histedit: convert pick action into a class · 477e7693
      Durham Goode authored
      This converts the pick action into a histeditclass instance, as part of an
      ongoing effort to refactor histedit for maintainability and robustness.
      
      The test output changed because previously pick would only report the commit
      disappearing if there were no merge conflicts. Now that we've unified the normal
      and the --continue flows, they act the same and we get the warning even after
      --continue.
      477e7693
    • Durham Goode's avatar
      histedit: integrate action class into flow · cfb8f5e3
      Durham Goode authored
      This takes the newly added histeditaction class and integrates it into the
      histedit run and bootstrapcontinue logic. No actions implement the class yet,
      but they will be add in upcoming patches.
      cfb8f5e3
Loading