FreeBSD/contrib/subversion/subversion/libsvn_repos/dump.c
/* Using TRACKER, check what path at what revision in the repository must
   be checked to decide that whether PATH exists.  Return the info in
   *ORIG_PATH and *ORIG_REV, respectively.

   If the path is known to not exist, *ORIG_PATH will be NULL and *ORIG_REV
   will be SVN_INVALID_REVNUM.  If *ORIG_REV is SVN_INVALID_REVNUM, PATH
   has just been added in the revision currently being tracked.

   Use POOL for allocations.  Note that *ORIG_PATH may be allocated in POOL,
   a reference to internal data with the same lifetime as TRACKER or just
   PATH.
 */
Using TRACKER, check what path at what revision in the repository must
be checked to decide that whether PATH exists.  Return the info in
ORIG_PATH and *ORIG_REV, respectively.

If the path is known to not exist, *ORIG_PATH will be NULL and *ORIG_REV
will be SVN_INVALID_REVNUM.  If *ORIG_REV is SVN_INVALID_REVNUM, PATH
has just been added in the revision currently being tracked.

Use POOL for allocations.  Note that *ORIG_PATH may be allocated in POOL,
a reference to internal data with the same lifetime as TRACKER or just
PATH.
Using TRACKER check what path at what revision in the repository must be checked to decide that whether PATH exists . Return the info in ORIG_PATH and * ORIG_REV respectively . If the path is known to not exist * ORIG_PATH will be NULL and * ORIG_REV will be SVN_INVALID_REVNUM . If * ORIG_REV is SVN_INVALID_REVNUM PATH has just been added in the revision currently being tracked . Use POOL for allocations . Note that * ORIG_PATH may be allocated in POOL a reference to internal data with the same lifetime as TRACKER or just PATH .
static void
tracker_lookup(const char **orig_path,
               svn_revnum_t *orig_rev,
               path_tracker_t *tracker,
               const char *path,
               apr_pool_t *pool)
{
  tracker_trim(tracker, path, TRUE);
  if (tracker->depth == 0)
    {
      *orig_path = path;
      *orig_rev = tracker->revision - 1;
    }
  else
    {
      path_tracker_entry_t *parent = &APR_ARRAY_IDX(tracker->stack,
                                                    tracker->depth - 1,
                                                    path_tracker_entry_t);
      if (parent->exists)
        {
          const char *rel_path
            = svn_dirent_skip_ancestor(parent->path->data, path);
          if (parent->copyfrom_rev != SVN_INVALID_REVNUM)
            {
              *orig_path = svn_dirent_join(parent->copyfrom_path->data,
                                           rel_path, pool);
              *orig_rev = parent->copyfrom_rev;
            }
          else if (*rel_path == '\0')
            {
              *orig_path = path;
              *orig_rev = tracker->revision;
            }
          else
            {
              *orig_path = NULL;
              *orig_rev = SVN_INVALID_REVNUM;
            }
        }
      else
        {
          *orig_path = NULL;
          *orig_rev = SVN_INVALID_REVNUM;
        }
    }
}
static void tracker_lookup ( const char * * orig_path , svn_revnum_t * orig_rev , path_tracker_t * tracker , const char * path , apr_pool_t * pool ) { tracker_trim ( tracker , path , TRUE ) ; if ( tracker -> depth == 0 ) { * orig_path = path ; * orig_rev = tracker -> revision - 1 ; } else { path_tracker_entry_t * parent = & APR_ARRAY_IDX ( tracker -> stack , tracker -> depth - 1 , path_tracker_entry_t ) ; if ( parent -> exists ) { const char * rel_path = svn_dirent_skip_ancestor ( parent -> path -> data , path ) ; if ( parent -> copyfrom_rev != SVN_INVALID_REVNUM ) { * orig_path = svn_dirent_join ( parent -> copyfrom_path -> data , rel_path , pool ) ; * orig_rev = parent -> copyfrom_rev ; } else if ( * rel_path == ' \0 ' ) { * orig_path = path ; * orig_rev = tracker -> revision ; } else { * orig_path = NULL ; * orig_rev = SVN_INVALID_REVNUM ; } } else { * orig_path = NULL ; * orig_rev = SVN_INVALID_REVNUM ; } } }
Using TRACKER, check what path at what revision in the repository must
be checked to decide that whether PATH exists.
Using TRACKER check what path at what revision in the repository must be checked to decide that whether PATH exists .
/* no tree changes -> paths are the same as in the previous rev. */ /* parent is a copy with history. Translate path. */ /* added in this revision with no history */ /* parent got added but not this path */ /* (maybe parent) path has been deleted */