mercurial/metadata.py
changeset 45666 f6811e5bd994
parent 45663 cf474af69766
child 45667 0303fc1f43f8
equal deleted inserted replaced
45665:308ca5528ee6 45666:f6811e5bd994
   224             self.mark_copied_from_p2(source, dest)
   224             self.mark_copied_from_p2(source, dest)
   225 
   225 
   226 
   226 
   227 def compute_all_files_changes(ctx):
   227 def compute_all_files_changes(ctx):
   228     """compute the files changed by a revision"""
   228     """compute the files changed by a revision"""
       
   229     p1 = ctx.p1()
       
   230     p2 = ctx.p2()
       
   231     if p1.rev() == node.nullrev and p2.rev() == node.nullrev:
       
   232         return _process_root(ctx)
   229     filescopies = computechangesetcopies(ctx)
   233     filescopies = computechangesetcopies(ctx)
   230     filesadded = computechangesetfilesadded(ctx)
   234     filesadded = computechangesetfilesadded(ctx)
   231     filesremoved = computechangesetfilesremoved(ctx)
   235     filesremoved = computechangesetfilesremoved(ctx)
   232     filesmerged = computechangesetfilesmerged(ctx)
   236     filesmerged = computechangesetfilesmerged(ctx)
   233     files = ChangingFiles()
   237     files = ChangingFiles()
   236     files.update_removed(filesremoved)
   240     files.update_removed(filesremoved)
   237     files.update_merged(filesmerged)
   241     files.update_merged(filesmerged)
   238     files.update_copies_from_p1(filescopies[0])
   242     files.update_copies_from_p1(filescopies[0])
   239     files.update_copies_from_p2(filescopies[1])
   243     files.update_copies_from_p2(filescopies[1])
   240     return files
   244     return files
       
   245 
       
   246 
       
   247 def _process_root(ctx):
       
   248     """compute the appropriate changed files for a changeset with no parents
       
   249     """
       
   250     # Simple, there was nothing before it, so everything is added.
       
   251     md = ChangingFiles()
       
   252     manifest = ctx.manifest()
       
   253     for filename in manifest:
       
   254         md.mark_added(filename)
       
   255     return md
   241 
   256 
   242 
   257 
   243 def computechangesetfilesadded(ctx):
   258 def computechangesetfilesadded(ctx):
   244     """return the list of files added in a changeset
   259     """return the list of files added in a changeset
   245     """
   260     """