mercurial/commands.py
changeset 723 9e0f3ba4a9c2
parent 705 574869103985
child 724 1c0c413cccdd
equal deleted inserted replaced
705:574869103985 723:9e0f3ba4a9c2
   305             if s != 'r' and not isfile:
   305             if s != 'r' and not isfile:
   306                 d.append(f)
   306                 d.append(f)
   307             elif s not in 'nmai' and isfile:
   307             elif s not in 'nmai' and isfile:
   308                 u.append(f)
   308                 u.append(f)
   309     else:
   309     else:
   310         (c, a, d, u) = repo.changes(None, None)
   310         (c, a, d, u) = repo.changes()
   311     repo.add(u)
   311     repo.add(u)
   312     repo.remove(d)
   312     repo.remove(d)
   313 
   313 
   314 def annotate(u, repo, file1, *files, **ops):
   314 def annotate(u, repo, file1, *files, **ops):
   315     """show changeset information per file line"""
   315     """show changeset information per file line"""
   582     if not parents:
   582     if not parents:
   583         ui.write("unknown\n")
   583         ui.write("unknown\n")
   584         return
   584         return
   585 
   585 
   586     hexfunc = ui.verbose and hg.hex or hg.short
   586     hexfunc = ui.verbose and hg.hex or hg.short
   587     (c, a, d, u) = repo.changes(None, None)
   587     (c, a, d, u) = repo.changes()
   588     output = ["%s%s" % ('+'.join([hexfunc(parent) for parent in parents]),
   588     output = ["%s%s" % ('+'.join([hexfunc(parent) for parent in parents]),
   589                         (c or a or d) and "+" or "")]
   589                         (c or a or d) and "+" or "")]
   590 
   590 
   591     if not ui.quiet:
   591     if not ui.quiet:
   592         # multiple tags for a single parent separated by '/'
   592         # multiple tags for a single parent separated by '/'
   982     C = changed
   982     C = changed
   983     A = added
   983     A = added
   984     R = removed
   984     R = removed
   985     ? = not tracked'''
   985     ? = not tracked'''
   986 
   986 
   987     (c, a, d, u) = repo.changes(None, None)
   987     (c, a, d, u) = repo.changes()
   988     (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u))
   988     (c, a, d, u) = map(lambda x: relfilter(repo, x), (c, a, d, u))
   989 
   989 
   990     for f in c:
   990     for f in c:
   991         ui.write("C ", f, "\n")
   991         ui.write("C ", f, "\n")
   992     for f in a:
   992     for f in a:
  1013 
  1013 
  1014     if opts['local']:
  1014     if opts['local']:
  1015         repo.opener("localtags", "a").write("%s %s\n" % (r, name))
  1015         repo.opener("localtags", "a").write("%s %s\n" % (r, name))
  1016         return
  1016         return
  1017 
  1017 
  1018     (c, a, d, u) = repo.changes(None, None)
  1018     (c, a, d, u) = repo.changes()
  1019     for x in (c, a, d, u):
  1019     for x in (c, a, d, u):
  1020         if ".hgtags" in x:
  1020         if ".hgtags" in x:
  1021             ui.warn("abort: working copy of .hgtags is changed!\n")
  1021             ui.warn("abort: working copy of .hgtags is changed!\n")
  1022             ui.status("(please commit .hgtags manually)\n")
  1022             ui.status("(please commit .hgtags manually)\n")
  1023             return -1
  1023             return -1