summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-11-12 18:19:00 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-11-12 17:42:14 +0000
commit7d961ddc443a31d71cd3d2c02a397128da9be120 (patch)
tree19284e37e91d2c080f7e4126d76e2768a3a37612
parentc338dede1b5bdab240a237581644158ba56249b3 (diff)
downloadsamba-7d961ddc443a31d71cd3d2c02a397128da9be120.tar.gz
samba-7d961ddc443a31d71cd3d2c02a397128da9be120.tar.bz2
samba-7d961ddc443a31d71cd3d2c02a397128da9be120.zip
samba_version: Simplify dirty tree detection.
-rw-r--r--buildtools/wafsamba/samba_version.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index f398e4d68a..6e8764db64 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -3,7 +3,7 @@ import Utils
def bzr_version_summary(path):
try:
- from bzrlib import branch, osutils
+ from bzrlib import branch, osutils, workingtree
except ImportError:
return ("BZR-UNKNOWN", {})
@@ -36,12 +36,11 @@ def bzr_version_summary(path):
fields["GIT_COMMIT_FULLREV"] = full_rev
ret = "GIT-" + fields["GIT_COMMIT_ABBREV"]
- clean = Utils.cmd_output('bzr diff | wc -l', silent=True)
- if clean == "0\n":
- fields["COMMIT_IS_CLEAN"] = "1"
- else:
+ if workingtree.WorkingTree.open(path).has_changes():
fields["COMMIT_IS_CLEAN"] = "0"
ret += "+"
+ else:
+ fields["COMMIT_IS_CLEAN"] = "1"
return (ret, fields)