Skip to content
Snippets Groups Projects
  1. Jul 11, 2012
  2. Jul 10, 2012
    • epriestley's avatar
      templatekw/help: document the {parents} keyword · 293dd81e4601
      epriestley authored
      The {parents} keyword does not appear in the generated documentation for
      templates because it is added by `changeset_templater` (and this is because
      its behavior depends on `ui`, so it can't be defined as a normal template
      keyword; see comments in `changeset_templater._show()`).
      
      Add it to the documentation synthetically by creating a stub documentation
      function.
      
      Test plan: built the docs and examined the man page to verify that this
      keyword is now documented. I'm not sure how to test the i18n extraction part,
      but assume it will just work given that this patch doesn't do anything too
      crazy.
      293dd81e4601
  3. Jul 07, 2012
    • Matt Harbison's avatar
      revset: add destination() predicate · a3da6f298592
      Matt Harbison authored
      This predicate is used to find csets that were created because of a graft,
      transplant or rebase --keep.  An optional revset can be supplied, in which case
      the result will be limited to those copies which specified one of the revs as
      the source for the command.
      
          hg log -r destination()                 # csets copied from anywhere
          hg log -r destination(branch(default))  # all csets copied from default
      
          hg log -r origin(x) or destination(origin(x))  # all instances of x
      
      This predicate will follow a cset through different types of copies.  Given a
      repo with a cset 'S' that is grafted to create G(S), which itself is
      transplanted to become T(G(S)):
      
          o-S
         /
        o-o-G(S)
         \
          o-T(G(S))
      
          hg log -r destination( S )    # { G(S), T(G(S)) }
          hg log -r destination( G(S) ) # { T(G(S)) }
      
      The implementation differences between the three different copy commands (see
      the origin() predicate) are not intentionally exposed, however if the
      transplant was a graft instead:
      
      	hg log -r destination( G(S) )   # {}
      
      because the 'extra' field in G(G(S)) is S, not G(S).  The implementation cannot
      correct this by following sources before G(S) and then select the csets that
      reference those sources because the cset provided to the predicate would also
      end up selected.  If there were more than two copies, sources of the argument
      would also get selected.
      
      Note that the convert extension does not currently update the 'extra' map in its
      destination csets, and therefore copies made prior to the convert will be
      missing from the resulting set.
      
      Instead of the loop over 'subset', the following almost works, but does not
      select a transplant of a transplant.  That is, 'destination(S)' will only
      select T(S).
      
          dests = set([r for r in subset if _getrevsource(repo, r) in args])
      a3da6f298592
    • Matt Harbison's avatar
      revset: add origin() predicate · 2c7c4824969e
      Matt Harbison authored
      This predicate is used to find the original source of csets created by a graft,
      transplant or rebase --keep.  If a copied cset is itself copied, only the
      source of the original copy is selected.
      
          hg log -r origin()                # all src csets, anywhere
          hg log -r origin(branch(default)) # all srcs of copies on default
      
      By following through different types of copy commands and only selecting the
      original cset, the implementation differences between the copy commands are
      hidden.  (A graft of a graft preserves the original source in its 'extra' map,
      while transplant and rebase use the immediate source specified for the
      command).
      
      Given a repo with a cset S that is grafted to create G(S), which itself is
      grafted to become G(G(S))
      
          o-S
         /
        o-o-G(S)
         \
          o-G(G(S))
      
          hg log -r origin( G(S) )      # { S }
          hg log -r origin( G(G(S)) )   # { S }, NOT { G(S) }
      
      Even if the last graft were a transplant
      
          hg log -r origin( T(G(S)) )   # { S }
      
      A rebase without --keep essentially strips the source, so providing the cset
      that results to this predicate will yield an empty set.
      
      Note that the convert extension does not currently update the 'extra' map in
      its destination csets, and therefore copies made prior to the convert will be
      unable to find their source.
      2c7c4824969e
  4. Jul 16, 2012
  5. Jul 12, 2012
  6. Jul 11, 2012
  7. Jul 14, 2012
  8. Jul 11, 2012
  9. Jun 24, 2012
  10. Jul 14, 2012
  11. Jul 15, 2012
  12. Jul 06, 2012
    • Wagner Bruna's avatar
      convert: make filemap renames consistently override revision renames · 32b2e6d641e4
      Wagner Bruna authored
      When the source repository had a revision renaming "$new -> $old",
      but the filemap a "$old -> $new" rename, the converted revision could
      use either $new (deleting the file) or $old (keeping the file) when
      getting the file data, depending on the lexicographical order of
      those names. So the resulting revision would leave some files
      untouched (as expected), but delete others arbitrarely.
      32b2e6d641e4
    • Pierre-Yves David's avatar
      obsolete: compute extinct changesets · c621f84dbb35
      Pierre-Yves David authored
      `extinct` changesets are obsolete changesets with obsolete descendants only. They
      are of no interest anymore and can be:
      
      - exclude from exchange
      - hidden to the user in most situation
      - safely garbage collected
      
      This changeset just allows mercurial to detect them.
      
      The implementation is a bit naive, as for unstable changesets. We better use a
      simple revset query and a cache, but simple version comes first.
      c621f84dbb35
  13. Jul 09, 2012
    • Pierre-Yves David's avatar
      push: refuse to push unstable changesets without force · 12fdaa30063a
      Pierre-Yves David authored
      User should resolve unstability locally before pushing the same way we encourage
      user to merge locally instead of pushing a new remote head.
      
      If we are to push obsolete changeset, at least one set of the pushed set will be
      either obsolete or unstable. The check is narrowed to only heads.
      12fdaa30063a
  14. Jul 05, 2012
    • Pierre-Yves David's avatar
      obsolete: compute unstable changeset · 9c750c3e4fac
      Pierre-Yves David authored
      An unstable changeset is a changeset *not* obsolete but with some obsolete
      ancestors.
      
      The current logic to decide if a changeset is unstable is naive and very
      inefficient. A better solution is to compute the set of unstable changeset with
      a simple revset and to cache the result. But this require cache invalidation
      logic. Simpler version goes first.
      9c750c3e4fac
  15. Jul 06, 2012
  16. Jul 09, 2012
  17. Jul 05, 2012
  18. Jul 06, 2012
  19. Jul 04, 2012
  20. Jul 05, 2012
    • kiilerix's avatar
      parsers.c: remove warning: 'size' may be used uninitialized in this function · 249cc4ec4327
      kiilerix authored
      Some compilers / compiler options (such as gcc 4.7) would emit warnings:
      
      mercurial/parsers.c: In function 'pack_dirstate':
      mercurial/parsers.c:306:18: warning: 'size' may be used uninitialized in this function [-Wmaybe-uninitialized]
      mercurial/parsers.c:306:12: warning: 'mode' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      It is apparently not smart enough to figure out how the 'err' arithmetics makes
      sure that it can't happen.
      
      'err' is now replaced with simple checks and goto. That might also help the
      optimizer when it is inlining getintat().
      249cc4ec4327
  21. Jul 11, 2012
  22. Jul 06, 2012
    • Katsunori FUJIWARA's avatar
      localrepo: use file API via vfs while ensuring repository directory · be016e96117a
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch invokes some file API
      indirectly via vfs, while ensuring repository directory in the
      constructor of "localrepository" class.
      
      New file API are added to "scmutil.abstractopener" class, because they
      are also used via other derived classes than "scmutil.opener".
      
      But "join()" is not yet defined other than "scmutil.opener" class,
      because it should not be used via other opener classes yet.
      be016e96117a
    • Katsunori FUJIWARA's avatar
      localrepo: use "vfs" intead of "opener" while ensuring repository directory · 22b9b1d2f5d4
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch uses "self.vfs" instead of
      "self.opener", while ensuring repository directory in the constructor
      of "localrepository" class.
      22b9b1d2f5d4
    • Katsunori FUJIWARA's avatar
      localrepo: use the path relative to "self.vfs" instead of "path" argument · 36a3016811d1
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch uses "self.root", which can
      be recognized as the path relative to "self.vfs", instead of "path"
      argument.
      
      This fix allows to make invocations of "util.makedirs()" and
      "os.path.exists()" while ensuring repository directory in
      "localrepository.__init__()" ones indirectly via vfs.
      
      But this fix also raises issue 2528: "hg clone" with empty destination.
      
      "path" argument is empty in many cases, so this issue can't be fixed
      in the view of "localrepository.__init__()".
      
      Before this patch, it is fixed by empty-ness check ("not name") of
      exception handler in "util.makedirs()".
      
          try:
              os.mkdir(name)
          except OSError, err:
              if err.errno == errno.EEXIST:
                  return
              if err.errno != errno.ENOENT or not name:
                  raise
      
      This requires "localrepository.__init__()" to invoke "util.makedirs()"
      with "path" instead of "self.root", because empty "path" is treated as
      "current directory" and "self.root" becomes valid path.
      
      But "hg clone" with empty destination can be detected also in
      "hg.clone()" before "localrepository.__init__()" invocation, so this
      patch re-fixes issue2528 by checking it in "hg.clone()".
      36a3016811d1
    • Katsunori FUJIWARA's avatar
      localrepo: use "self.wvfs.join()" instead of "os.path.join()" · 60338880d265
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch uses "self.wvfs.join()"
      instead of "os.path.join()", while initialization of fields in the
      constructor of "localrepository" class.
      60338880d265
    • Katsunori FUJIWARA's avatar
      localrepo: use path expansion API via vfs · 87e8440964a0
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch moves path expansion API
      invocations in the constructor of "localrepository" to the constructor
      of "opener", because the root path to the repository is very important
      to handle paths using non-ASCII characters correctly.
      
      This patch also rearrange initialization order of "wvfs" field,
      because it is required to initialize "self.root".
      87e8440964a0
    • Katsunori FUJIWARA's avatar
      localrepo: add "vfs" fields to "localrepository" for migration from "opener" · 7034365089bf
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch adds "vfs" fields to
      "localrepository" class.
      
      This allows new codes to access current "opener" objects related to
      repositories via "vfs" fields, so patches referring to "vfs" will
      replace referring to "opener" in time.
      
      This patch also adds initializations for "vfs" fields to
      "statichttprepository" class derived from it, because its constructor
      doesn't invoke the constructor of "localrepository", so "vfs" fields
      should be initialized explicitly as same as "opener" fields: it has no
      working directory, so "wvfs" field is not added.
      7034365089bf
  23. Jul 13, 2012
  24. Jun 25, 2012
  25. Jun 27, 2012
    • Katsunori FUJIWARA's avatar
      mq: check subrepo synchronizations against parent of workdir or other appropriate context · 54da604fefee
      Katsunori FUJIWARA authored
      Before this patch, MQ checks each subrepo synchronizations against the
      working directory context, so ".hgsubstate" updating is not imported
      into MQ revision correctly in cases below:
      
        - qrefresh when current ".hgsubstate" is already synchronized with
          each subrepos: you can reproduce this easily by just twice or more
          qrefresh invocations
      
        - qnew just after rollback of commit which updates ".hgsubstate"
      
      This patch resolves this by checking subrepo states against:
      
        - the parent of "qtop" for qrefresh, or
        - the parent of working context otherwise
      54da604fefee
    • Katsunori FUJIWARA's avatar
      mq: create patch file after commit to import diff of ".hgsubstate" at qrefresh · f287d4a62031
      Katsunori FUJIWARA authored
      Even though the committed revision contains diff of ".hgsubstate", the
      patch file created by qrefresh doesn't contain it, because:
      
        - ".hgsubstate" is not listed up as one of target files of the patch
          for reasons below, so diff of ".hgsubstate" is not imported into
          patch file
      
            - status of ".hgsubstate" in working directory is usually "clean"
            - ".hgsubstate" is not specified explicitly by users
      
        - the patch file is created before commit processing which updates
          or creates ".hgsubstate" automatically, so there is no diff for it
          at that time
      
      This patch resolves this problem by:
      
        - putting ".hgsubstate" into target list of the patch, if needed:
          this allows "patch.diff()" to import diff of ".hgsubstate" into
          patch file.
      
        - creating the patch file after commit processing:
          this updates ".hgsubstate" before "patch.diff()" invocation.
      
      For the former fixing, this patch introduces "putsubstate2changes()"
      to share same implementation with qnew. This is invoked only once per
      qnew/qrefresh at most, so there is less performance impact.
      
      This patch also omits "match" argument for "patch.diff()" invocation,
      because "patch.diff()" ignores "match" if "changes" is specified.
      f287d4a62031
    • Katsunori FUJIWARA's avatar
      mq: add ".hgsubstate" to patch target list only if it is not listed up yet · 986df5249b65
      Katsunori FUJIWARA authored
      If ".hgsubstate" is already listed up as one of commit targets, qnew
      put diff of ".hgsubstate" twice into the patch file stored under
      ".hg/patches".
      
      It causes rejections at applying such patches.
      
      Other than the case like in added test script, this can also occur
      when qnew is executed just after rolling back the committing updated
      ".hgsubstate".
      
      This patch checks whether ".hgsubstate" is already listed up as one of
      commit targets, and put it into the appropriate list only if it is not
      listed up yet.
      986df5249b65
  26. Jul 12, 2012
Loading