Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 710:ca9353f43345
Use dirstate to check if .hgtags needs to be added.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Use dirstate to check if .hgtags needs to be added.
manifest hash: f90af1553754eb703fc457ffdd5ded0de6fa47e0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
iD8DBQFC15i1W7P1GVgWeRoRArDvAKCSxWDCbwU12ICwwVUoe753H8GYIwCfZGs0
HcL8cOp+eHz85AMJJE/xfck=
=1xKK
-----END PGP SIGNATURE-----
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 15 Jul 2005 12:06:29 +0100 |
parents | cc2e8f3d4412 |
children | b4f0fad0ea64 |
comparison
equal
deleted
inserted
replaced
709:cc2e8f3d4412 | 710:ca9353f43345 |
---|---|
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 |
1024 | 1024 |
1025 add = not os.path.exists(repo.wjoin(".hgtags")) | |
1026 repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name)) | 1025 repo.wfile(".hgtags", "ab").write("%s %s\n" % (r, name)) |
1027 if add: | 1026 if repo.dirstate.state(".hgtags") == '?': |
1028 repo.add([".hgtags"]) | 1027 repo.add([".hgtags"]) |
1029 | 1028 |
1030 if not opts['text']: | 1029 if not opts['text']: |
1031 opts['text'] = "Added tag %s for changeset %s" % (name, r) | 1030 opts['text'] = "Added tag %s for changeset %s" % (name, r) |
1032 | 1031 |