[MediaWiki-commits] [Gerrit] translatewiki[master]: Add Bazaar support to RepoNG

2017-12-04 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394315 )

Change subject: Add Bazaar support to RepoNG
..


Add Bazaar support to RepoNG

Untested

Change-Id: Icaaa5ca3058a7196a83b4de20c6f347b0c0f37ef
---
A bin/clupdate-bzr-repo
M repong/repong.php
2 files changed, 22 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Nikerabbit: Looks good to me, approved



diff --git a/bin/clupdate-bzr-repo b/bin/clupdate-bzr-repo
new file mode 100644
index 000..3eb9f70
--- /dev/null
+++ b/bin/clupdate-bzr-repo
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+set -u
+
+URL=$1
+DIR=$2
+BRANCH=${3:-master}
+
+if [ -d "$DIR/.bzr" ]
+then
+   cd "$DIR"
+   bzr revert --quiet
+   bzr pull "$BRANCH" --quiet --overwrite
+else
+   bzr checkout ${URL}/${BRANCH} "$DIR"
+fi
diff --git a/repong/repong.php b/repong/repong.php
index c58863f..851af4f 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -241,6 +241,8 @@
$command = "$bindir/clupdate-gerrit-repo 
'{$repo['url']}' '$base/$name' '$branch'";
} elseif ( $type === 'svn' ) {
$command = "$bindir/clupdate-svn-repo  
'{$repo['url']}' '$base/$name'";
+   } elseif ( $type === 'bzr' ) {
+   $command = "$bindir/clupdate-bzr-repo  
'{$repo['url']}' '$base/$name' '$branch'";
} else {
throw new RuntimeException( 'Unknown repo type' 
);
}
@@ -373,6 +375,10 @@
"cd '$dir'; " .
"svn add --force * --auto-props 
--parents --depth infinity -q$extra; " .
"svn commit --message '$message'";
+   } elseif ( $repo['type'] === 'bzr' ) {
+   $dir = "$base/$name";
+   $branch = isset( $repo['branch'] ) ? 
$repo['branch'] : 'master';
+   $command = "cd '$dir'; bzr add .;bzr commit -m 
'$message'";
} else {
throw new RuntimeException( 'Unknown repo type' 
);
}

-- 
To view, visit https://gerrit.wikimedia.org/r/394315
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icaaa5ca3058a7196a83b4de20c6f347b0c0f37ef
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 
Gerrit-Reviewer: Nikerabbit 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] translatewiki[master]: Add Bazaar support to RepoNG

2017-11-30 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394315 )

Change subject: Add Bazaar support to RepoNG
..

Add Bazaar support to RepoNG

Untested

Change-Id: Icaaa5ca3058a7196a83b4de20c6f347b0c0f37ef
---
A bin/clupdate-bzr-repo
M repong/repong.php
2 files changed, 22 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/translatewiki 
refs/changes/15/394315/1

diff --git a/bin/clupdate-bzr-repo b/bin/clupdate-bzr-repo
new file mode 100644
index 000..1153500
--- /dev/null
+++ b/bin/clupdate-bzr-repo
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+set -u
+
+URL=$1
+DIR=$2
+BRANCH=${3:-master}
+
+if [ -d "$DIR/.bzr" ]
+then
+   cd "$DIR"
+bzr revert --quiet
+   bzr pull "$BRANCH" --quiet --overwrite
+else
+   bzr checkout ${URL}/${BRANCH} "$DIR"
+fi
diff --git a/repong/repong.php b/repong/repong.php
index c58863f..851af4f 100644
--- a/repong/repong.php
+++ b/repong/repong.php
@@ -241,6 +241,8 @@
$command = "$bindir/clupdate-gerrit-repo 
'{$repo['url']}' '$base/$name' '$branch'";
} elseif ( $type === 'svn' ) {
$command = "$bindir/clupdate-svn-repo  
'{$repo['url']}' '$base/$name'";
+   } elseif ( $type === 'bzr' ) {
+   $command = "$bindir/clupdate-bzr-repo  
'{$repo['url']}' '$base/$name' '$branch'";
} else {
throw new RuntimeException( 'Unknown repo type' 
);
}
@@ -373,6 +375,10 @@
"cd '$dir'; " .
"svn add --force * --auto-props 
--parents --depth infinity -q$extra; " .
"svn commit --message '$message'";
+   } elseif ( $repo['type'] === 'bzr' ) {
+   $dir = "$base/$name";
+   $branch = isset( $repo['branch'] ) ? 
$repo['branch'] : 'master';
+   $command = "cd '$dir'; bzr add .;bzr commit -m 
'$message'";
} else {
throw new RuntimeException( 'Unknown repo type' 
);
}

-- 
To view, visit https://gerrit.wikimedia.org/r/394315
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icaaa5ca3058a7196a83b4de20c6f347b0c0f37ef
Gerrit-PatchSet: 1
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits